Binding Language Models in Symbolic Languages

Zhoujun Cheng, Tianbao Xie, Peng Shi, Chengzu Li, Rahul Nadkarni, Yushi Hu, Caiming Xiong, Dragomir Radev, Mari Ostendorf, Luke Zettlemoyer, Noah A. Smith, Tao Yu

Overview

BINDER is a training-free, neural-symbolic framework that bridges the gap between the rigid logic of programming languages (like SQL and Python) and the flexible reasoning of Large Language Models (LLMs). By mapping natural language questions into programs that feature "API calls" back to an LLM, BINDER achieves state-of-the-art performance on complex table reasoning tasks using only a handful of examples and zero fine-tuning.

The Challenge: Flexibility vs. Robustness

In the world of Natural Language Processing (NLP), there is a long-standing tension between end-to-end neural systems and symbolic approaches.

End-to-end models (like standard GPT-4) are incredibly flexible but often act as "black boxes." They lack interpretability and struggle with robustness when inputs become too large or noisy. Conversely, symbolic approaches (like parsing a question into a SQL query) are highly interpretable and robust, but they are limited by the strict "grammar" of the language. For instance, a standard SQL query cannot easily determine if a specific city is in "North America" unless that exact geographical mapping explicitly exists in the database.

The authors address this "semantic coverage" gap. They aim to create a system that retains the logical, executable structure of a program but can "call out" to an LLM for sub-tasks requiring commonsense knowledge, information extraction, or complex linguistic reasoning.

The BINDER Framework

BINDER (Binding Language Models in Symbolic Languages) operates in two main stages:

The BINDER framework architecture
  1. Parsing Stage: The system uses an LLM (specifically GPT-3 Codex) to translate a natural language question into a BINDER program. This is a standard program (SQL or Python) that includes unified API calls—represented as f(question; context). Codex identifies which parts of the question can be handled by standard logic (e.g., sorting, filtering) and which parts require an LLM "plugin."
  2. Execution Stage: A deterministic program interpreter runs the code. When it encounters an API call, it prompts the LLM to resolve that specific sub-task (e.g., "Is this shirt made of pure cotton?"). The results are fed back into the program to derive the final answer.

Crucially, BINDER is training-free. It relies entirely on in-context learning, meaning it only needs a small number of annotated examples (around 14 exemplars) in the prompt to learn how to generate these hybrid programs.

Datasets Evaluated

The researchers evaluated BINDER on three challenging benchmarks:

  • WIKITABLEQUESTIONS (WIKITQ): Requires complex reasoning and multi-step calculations over Wikipedia tables.
  • TABFACT: A large-scale dataset for table-based fact verification (binary classification).
  • MULTIMODALQA (MMQA): A dataset requiring joint reasoning across text, tables, and images. For images, the authors used a vision-text model (OFA) to generate captions that BINDER could then process.

Key Insights

  • The LLM as a "Unified API": Instead of building custom neural modules for every possible task (sorting, sentiment, geography), BINDER treats the LLM as a general-purpose function that can be "bound" to any symbolic language.
  • Extending Grammar via API: By allowing API calls within SQL/Python, the authors effectively extend the "grammar" of these languages to include the entire world-knowledge base of the LLM.
  • Interpretability for Debugging: Because the output is a readable program, humans can see exactly where the logic failed—whether it was a bad SQL join or an incorrect LLM API response.

Key Results

  • State-of-the-Art Performance: BINDER achieved 64.6% accuracy on WIKITQ and 85.1% on TABFACT.
  • Efficiency: Remarkably, BINDER outperformed previous best systems that were fine-tuned on over 10,000 task-specific samples, despite BINDER using only dozens of annotations as in-context examples.
  • Solving the "Unsolvable": On a subset of WIKITQ questions that are considered "program-unsolvable" (meaning standard SQL cannot answer them), BINDER outperformed pure SQL by 10.1%.
  • Robustness and Scalability: End-to-end models often fail when a table is too large to fit into their context window. BINDER solves this by using the LLM to write a program based on the table schema and just a few rows. The program is then executed on the full dataset by a traditional interpreter, showing significantly higher stability than end-to-end models when faced with extremely large tables (up to 500 rows).
Accuracy comparison on varying input table sizes

Limitations and Future Work

  • Latency and Cost: Executing a BINDER program requires multiple calls to an LLM API, which can be slower and more expensive than a single end-to-end pass.
  • Error Propagation: If the LLM makes a mistake during the initial parsing stage (writing the program), the execution stage cannot recover.
  • LLM Hallucinations: While symbolic logic constrains the LLM, the API calls themselves are still susceptible to the underlying model's potential for hallucination.
  • Future Directions: The authors suggest exploring more powerful LMs, better in-context selection methods, and expanding the framework to even more diverse symbolic languages and multi-modal tasks.

Summary updated

BibTeX
@inproceedings{cheng2023binding,
  author = {Zhoujun Cheng and Tianbao Xie and Peng Shi and Chengzu Li and Rahul Nadkarni and Yushi Hu and Caiming Xiong and Dragomir Radev and Mari Ostendorf and Luke Zettlemoyer and Noah A. Smith and Tao Yu},
  title = {{Binding Language Models in Symbolic Languages}},
  booktitle = {International Conference on Learning Representations},
  year = {2023},
  url = {https://openreview.net/forum?id=lH1PV42cbF},
}
Figure