Cognitive Modeling with Scaffolded LLMs: A Case Study of Referential Expression Generation

Polina Tsvilodub, Michael Franke, Fausto CarcassiarXiv 2024

TL;DR

This paper introduces a neuro-symbolic, iterative cognitive model that scaffolds Large Language Models (LLMs) with symbolic logic to overcome the "closed-world" limitations of traditional language generation models. By embedding gpt-3.5-turbo within the algorithmic structure of a classic cognitive model, the hybrid approach successfully generates precise, contrastive descriptions in complex communication games without requiring task-specific fine-tuning.

What Problem Does This Paper Address?

When we speak, we naturally tailor our language to our context—a task cognitive scientists study using "reference games." If you need to point out a specific object among distractors (e.g., identifying a specific blue cup among several other cups), you must generate a referential expression that is uniquely descriptive.

Traditional computational models of this process suffer from a "closed world" problem: they require a pre-specified, hand-crafted list of vocabulary, attributes, and grammar rules to map utterances to world states. While modern LLMs offer open-ended language generation, using them as pure black boxes lacks explicit cognitive structure and can lead to unpredictable reasoning.

The authors bridge this gap by asking: To what extent can LLMs be used as plug-and-play components within a structured, algorithmic cognitive model?

Methods

The authors design an Iterative Model (IM) based on the classic Incremental Algorithm by Dale & Reiter (1995). Instead of generating a full description all at once, the model builds descriptions incrementally through a neuro-symbolic loop:

  1. UtterancesProposer (LLM-based): Given a target object, the LLM is prompted to generate simple candidate descriptions, intentionally constrained to mention only a single detail at first (simulating human cognitive production costs).
  2. SemanticEvaluator (LLM-based): The LLM evaluates whether each candidate description is literally true for the target and all surrounding distractor objects.
  3. ContrastivitySelector (Symbolic): A rule-based component calculates a contrastivity score ($C$) for each utterance, measuring how many distractors it successfully rules out.
  4. InfoMaxSelector (Symbolic): If an utterance uniquely identifies the target ($C = 1$), the loop terminates, and the description is returned.

If no single utterance is fully contrastive, the symbolic component selects the best partial descriptions and feeds them back into the UtterancesProposer to add another layer of detail. This process repeats iteratively, effectively searching a tree of possible descriptions.

Figure 1. The figure shows two iterations of the model, ending with the production of a contrastive utterance. T, D1, and D2 denote the target and the two distractor states respectively. C indicates the contrastivity values. Only the target is passed to the utterance proposer. Boxes with a brown border indicate LLM-based modules, components with green symbolic modules. The labels of the modules indicate section numbers in the appendix containing the full details.

The authors compare this iterative approach against two baselines: an ablated Single-Pass (SP) model (which samples multiple utterances but selects the best one in a single step without iterating) and a standard One-Shot Chain-of-Thought (CoT) LLM baseline.

Datasets

The models were evaluated using A3DS (Tsvilodub & Franke, 2023), a dataset derived from the 3Dshapes benchmark. A3DS provides highly structured textual descriptions of 3D geometric scenes, detailing attributes like object shape, size, position, and the colors of the object, wall, and floor. This structured environment allows the researchers to automatically verify whether a generated utterance successfully isolates a target without relying on expensive human annotation.

Key Insights and Ideas

  • Scaffolding Beats Black Boxes: Wrapping an LLM in a symbolic, algorithmic loop yields superior performance compared to simply asking the LLM to solve the task in a single, one-shot prompt.
  • Dynamic Computational Depth: The hybrid model naturally scales its complexity based on the difficulty of the task. When more distractors are present, the model automatically runs for more iterations (deeper tree search) to find a sufficiently descriptive phrase.
  • Width vs. Depth Trade-off: The authors observed a clear trade-off in the search tree: proposing more candidate utterances per step (wider tree width) makes it more likely to find a contrastive feature early on, thereby reducing the number of sequential iterations needed (shallower tree depth).

Key Results

  • Superior Contrastivity: The Iterative Model (IM) significantly outperformed both the single-pass ablation and the one-shot LLM baseline as the number of distractors scaled up to 4 and 8.
Figure 2. Distribution over contrastivity values (y-axis) by number of distractors (x-axis) and number of utterances proposed (color). Error bars show bootstrapped 95%-CIs.
  • Task-Driven Iteration: As context complexity increased, the model successfully adjusted its behavior, requiring more tree depth to resolve highly ambiguous scenes.
Figure 3. Development of task success over increasing tree depth in the IM: distribution over contrastivity values (y-axis) over in- creasing tree depth (extended utterance proposal and evaluation iterations; x-axis), by number of distractors (facets) and tree width (number of proposed utterances; color). Dots indicate means, thick bars indicate quartiles, thinner lines indicate minimal values.
  • Zero-Shot Efficiency: Unlike prior attempts to fine-tune image-captioning models on A3DS via reinforcement learning (which only achieved an accuracy of 0.54 in simple settings), this zero-shot neuro-symbolic approach achieved near-perfect contrastivity out-of-the-box without any task-specific training.

Limitations and Future Work

  • Error Propagation: The system is highly dependent on the accuracy of the SemanticEvaluator. If the LLM makes a mistake regarding literal truth values in early iterations, those errors compound over time.
  • Verbosity and Repetition: When forced into higher iteration counts, the LLM occasionally produces repetitive phrasing, though the statements remain factually true.
  • LLM Vulnerabilities: The neural modules still inherit classic LLM limitations, including sensitivity to minor prompt variations and potential hallucinations.

For future work, the authors suggest replacing the sampling-based evaluation with explicit likelihood estimates directly from the LLM, exploring alternative search heuristics, and testing the framework using open-source language models.

Summary updated

Abstract

To what extent can LLMs be used as part of a cognitive model of language generation? In this paper, we approach this question by exploring a neuro-symbolic implementation of an algorithmic cognitive model of referential expression generation by Dale & Reiter (1995). The symbolic task analysis implements the generation as an iterative procedure that scaffolds symbolic and gpt-3.5-turbo-based modules. We compare this implementation to an ablated model and a one-shot LLM-only baseline on the A3DS dataset (Tsvilodub & Franke, 2023). We find that our hybrid approach is cognitively plausible and performs well in complex contexts, while allowing for more open-ended modeling of language generation in a larger domain.
BibTeX
@misc{tsvilodub2024cognitive,
  author = {Polina Tsvilodub and Michael Franke and Fausto Carcassi},
  title = {{Cognitive Modeling with Scaffolded LLMs: A Case Study of Referential Expression Generation}},
  year = {2024},
  eprint = {2407.03805},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2407.03805},
}
Figure