Research map / Large language models / Agents, code and math
Mastering Symbolic Operations: Augmenting Language Models with Compiled Neural Networks
Read the paperCheck your idea against 108,967 papers
AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.
Proposes Neural Comprehension, which plugs compiled neural networks (CoNNs, built via Tracr/RASP and an LLM-based AutoCoNN toolkit) into a pretrained LM with a gating scheme so that rule-based symbolic operations are executed exactly.
Problem
Language models struggle with deterministic symbolic operations and rule-based tasks (e.g., multi-digit addition, length generalization) because they learn rules implicitly from text statistics.
Approach
Integrate transformer modules whose attention weights are compiled from human-specified rules (CoNNs) into a standard LM, with a MoE-style gate that decides when a CoNN's one-hot output replaces the LM's token distribution, so the rule is executed without tools or interpreters.
Key results
- On GSM8K-Hard addition subset, NC reaches 21.2% average solve rate versus 20.8% for PAL and 18.8% for CoT across llama-2-7b, llama-2-70b and GLM-130B.
- With code-davinci-002 (GPT-3.5), CoT + NC gives 81.29% average versus 81.20% for CoT across five arithmetic datasets (small gain).
- CoNN parameter counts range from about 8.8K to 51.8M, roughly 1/3,000 to 1/20,000,000 of GPT-3, and latency rises only 1%-3% per the authors.
Measured effects reported in the paper
| What was changed | Where | Measured | Effect |
|---|---|---|---|
| integrate Addition and Subtraction CoNNs | GPT-3 (175B) CoT · GSM8K | problem solve rate (%): 13.84 -> 13.95 (+0.11) | Helped |
| integrate Addition and Subtraction CoNNs | GPT-3 (175B) CoT · SingleEq | problem solve rate (%): 62.02 -> 62.83 (+0.81) | Helped |
| integrate Addition and Subtraction CoNNs | GPT-3 (175B) CoT · AddSub | problem solve rate (%): 57.22 -> 60.25 (+3.03) | Helped |
| integrate Addition and Subtraction CoNNs | GPT-3 (175B) CoT · MultiArith | problem solve rate (%): 45.85 -> 45.85 (+0.0) | No clear effect |
| integrate Addition and Subtraction CoNNs | GPT-3 (175B) CoT · SVAMP | problem solve rate (%): 38.42 -> 38.62 (+0.2) | Helped |
| integrate Addition and Subtraction CoNNs | GPT-3.5 (175B) CoT · SingleEq | problem solve rate (%): 91.01 -> 91.01 (+0.0) | No clear effect |
| integrate Addition and Subtraction CoNNs | GPT-3.5 (175B) CoT · GSM8K | problem solve rate (%): 60.20 -> 60.42 (+0.22) | Helped |
| use explicit operational instructions instead of Examples alone (ablation) | AutoCoNN · Parity CoNN generation | successful generations: 3/20 -> 7/20 | Helped |
| use explicit operational instructions instead of Examples alone (ablation) | AutoCoNN · Reverse CoNN generation | successful generations: 11/20 -> 16/20 | Helped |
| use explicit operational instructions instead of Examples alone (ablation) | AutoCoNN · Last Letter CoNN generation | successful generations: 10/20 -> 12/20 | Helped |
| use explicit operational instructions instead of Examples alone (ablation) | AutoCoNN · Copy CoNN generation | successful generations: 15/20 -> 17/20 | Helped |
| increase training data from 1 million to 15 million examples (ablation) | T5-large · symbolic operations OOD length generalization | OOD performance | No clear effect |
Surprising findings
- Adding CoNN modules to GPT-3.5 yields near-zero gains on standard arithmetic datasets (e.g., 0.0 on SingleEq and AddSub), which the authors attribute to limited CoNN coverage.
- AutoCoNN failed to generate working Addition or Subtraction CoNNs (0/20), though it produced working Parity, Reverse, Last Letter and Copy modules.
Limitations
- Gating is sparse and treats LM and CoNNs as separate modules rather than a dense integration.
- AutoCoNN fails on harder operations such as Addition and Subtraction; scalability to many CoNNs is untested (up to five stacked).
- Addition and Subtraction CoNNs only support natural numbers, with minuend greater than subtrahend for subtraction.
Experimental setup
Datasets: GSM8K AddSub SingleEq MultiArith SVAMP GSM8K-Hard
Benchmarks: GSM8K SingleEq AddSub MultiArith SVAMP GSM8K-Hard AddSub+ length generalization addition (1-40 digits)
Metrics: accuracy solve rate (%) inference latency
Baselines: Vanilla Fine-tune Vanilla Few-shot Scratchpad Algorithmic PAL CoT
Builds on: Tracr RASP Looped Transformers as Programmable Computers chain-of-thought PAL
Closest papers by meaning
- Frugal LMs Trained to Invoke Symbolic Solvers Achieve Parameter-Efficient Arithmetic Reasoning (AAAI 2024 · similarity 0.88)
- Neural-Symbolic Recursive Machine for Systematic Generalization (ICLR 2024 · similarity 0.87)
- Large Language Models are Interpretable Learners (ICLR 2025 · similarity 0.87)
- Neural-Symbolic Collaborative Distillation: Advancing Small Language Models for Complex Reasoning Tasks (AAAI 2025 · similarity 0.86)
- Emergent Symbolic Mechanisms Support Abstract Reasoning in Large Language Models (ICML 2025 · similarity 0.86)
- Neuro-Symbolic Data Generation for Math Reasoning (NeurIPS 2024 · similarity 0.86)
Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.
