PunGraph improves pun understanding using sound and meaning networks

PunGraph: Retrieval-Enhanced Phonetic-Semantic Graph Reasoning for Pun Understanding

Computation and Language

Summary

Puns are tricky jokes that play on words sounding alike but having different meanings. The authors create PunGraph, a system that builds networks connecting words by how they sound and what they mean to help computers understand puns better. They also introduce a big new dataset of puns to test their method. Their approach helps smaller language models make fewer mistakes when figuring out puns and performs well compared to advanced models. This shows combining structured knowledge about sounds and meanings with language models can improve pun interpretation.

What this means in practice

  • For chatbot developers: Improve chatbot humor and pun recognition by integrating PunGraph’s phonetic-semantic graphs to guide language model responses.
  • For digital assistants teams: Enhance digital assistants' understanding of wordplay in user queries by using PunGraph’s retrieval system to constrain pun interpretation.

Authors

Yuchen Su, Zijian Huang, Yaotian Shi, Shaoxin Zhong, Ruofan Wang, Mengze Li, Yonghua Zhu, Diana Benavides-Prado, Michael Witbrock

Abstract

Puns are a challenging form of figurative language that exploit phonetic similarity and semantic ambiguity to convey multiple meanings. Although large language models (LLMs) demonstrate strong language understanding capabilities, they still struggle with pun reasoning due to limited phonetic modeling and uncontrolled end-to-end generation. We propose \textbf{PunGraph}, a retrieval-enhanced knowledge graph framework for pun understanding. PunGraph constructs a phonetic-semantic lexical graph using the Unisyn phonetic dictionary, IPA and G2P representations, and WordNet definitions, and retrieves candidate words or senses to constrain LLM reasoning within a structured candidate space. We further introduce \textbf{WebPun}, a new large-scale dataset containing 5,730 annotated heterographic and homographic puns. Experiments on SemEval-2017 and WebPun show that PunGraph consistently improves the performance of small-scale LLMs and achieves competitive results against strong proprietary models. Further analysis shows that retrieval-guided phonetic and semantic constraints effectively reduce common reasoning errors in pun interpretation, highlighting the benefits of integrating structured knowledge with LLMs. We release our code and dataset at https://github.com/ysu132/PunGraph.