Introduction
In Natural Language Processing (NLP), modeling lexical semantics—the meaning of words—remains a core challenge. While state-of-the-art Large Language Models (LLMs) like BERT or Llama generate powerful contextualized embeddings, these representations often function as "black boxes." They are difficult for humans to interpret and frequently conflate a word's core semantic meaning with the syntactic noise of its surrounding sentence.
This paper proposes a novel approach: using LLMs as "on-the-fly" lexicographers to generate precise, context-dependent dictionary definitions. By treating these generated definitions as intermediate representations, the authors demonstrate that they can serve as a robust "semantic bottleneck," outperforming standard token-based methods in tasks such as word sense induction and detecting lexical semantic change.
The LlamaDictionary Framework
The researchers developed LlamaDictionary by fine-tuning Llama-2 (7B) and Llama-3 (8B) models to transform word-in-context instances into human-readable definitions.
The pipeline consists of three primary stages:
- Instruction Fine-tuning: Using Low-Rank Adaptation (LoRA), the models were trained on a massive corpus of word-context-definition triplets sourced from major dictionaries. The models were prompted with a specific system role: "You are a lexicographer familiar with providing concise definitions of word meanings."
- Definition Generation: Given a target word and its example sentence, the model generates a text definition $d$ that captures the specific sense used in that context.
- Embedding Encoding: The generated definition is passed through a sentence-embedding model (SBERT) to produce a vector $v$. This vector serves as the final representation for downstream computational tasks.
This method effectively "denoises" the input by abstracting away the specific syntax of the example sentence, leaving a pure semantic representation of the word's usage.
Datasets and Evaluation
To ensure robust performance, the authors utilized a diverse set of datasets for training and evaluation:
- Core Training Data: Definitions and usage examples from the Oxford English Dictionary, WordNet, and Wiktionary.
- Generalization Tests: To evaluate the model's ability to handle unseen or informal language, it was tested on The Urban Dictionary (slang) and Wikipedia (rare words).
- Downstream Benchmarks: The utility of the generated embeddings was measured using Word-in-Context (WiC) tasks, Word Sense Induction (WSI) for discovering word senses, and Lexical Semantic Change (LSC) detection using the SemEval-2020 benchmark.
Experimental Results
The LlamaDictionary approach established several new state-of-the-art (SOTA) benchmarks for unsupervised semantic modeling.
Key performance metrics include:
- Definition Quality: Llama2Dictionary achieved a BLEU score of 0.513 on WordNet, a significant improvement over the previous best of 0.328.
- Word-in-Context (WiC): The method reached 0.731 accuracy, surpassing previous unsupervised SOTA baselines.
- Lexical Semantic Change: By clustering definitions to detect shifts in meaning over time, the model achieved a Spearman correlation of 0.667.
- Zero-Shot Generalization: Even on the unseen Wikipedia dataset, the models maintained high semantic accuracy with BERT-F1 scores between 0.84 and 0.86.
Discussion and Insights
The study revealed several critical insights into the behavior of LLMs in lexicographic tasks. First, interpretability is a major advantage; unlike standard embeddings, researchers can read the generated definitions to diagnose model errors.
Second, the authors observed a "Safety" Trade-off. Llama’s built-in safety tuning, intended to prevent toxic output, occasionally hindered its performance on the Urban Dictionary dataset. The model sometimes refused to define certain slang terms, leading to lower scores on informal language compared to models without such constraints.
Finally, comparing model versions showed that while Llama 3 is generally more capable, Llama 2 performed slightly better at adhering to the concise, formal style required for dictionary definitions, likely due to differences in their underlying instruction-tuning datasets.
Limitations and Future Work
Despite its success, the approach has limitations. It is currently English-centric, and its performance on low-resource languages remains to be tested. Additionally, the computational cost of generating a full text definition for every word occurrence is significantly higher than extracting hidden layers from a model like BERT. Future work will explore fine-tuning on larger sets of generated usage sentences to further refine the nuance of the produced definitions.
Summary updated