atlas

Research map / Large language models / Agents, code and math

When Do Program-of-Thought Works for Reasoning?

AAAI 2024 · Large language models › Agents, code and math · approach: LLM planning with symbolic tools · 8 citations (OpenAlex)

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 CIRS, an AST- and cyclomatic-complexity-based score for code rationales, finds mid-complexity program-of-thought data best for training LLaMA-7B reasoning, and uses it to filter synthesized math instructions and Code Alpaca.

Problem

When and why program-of-thought prompting improves LLM reasoning; which code data complexity levels help LLMs learn reasoning abilities.

Approach

Defines a complexity-impacted reasoning score as the product of an AST-based structural score (node count, node types, depth) and a logical score (Halstead-style difficulty times McCabe cyclomatic complexity), and uses it to stratify synthesized code data so that mid-complexity subsets are used for fine-tuning.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Train on mid-range-complexity code data rather than low- or high-complexity code dataLLaMA models trained for program-of-thought reasoning · AsDiv, GSM8K, MultiArith, and SVAMPaccuracyHelped
Increase model size from 7B to 65BLLaMA models trained on complexity-stratified code · Mathematical reasoning datasetsaccuracyHelped
Use high-complexity code data instead of mid-range-complexity code dataLLMs using program-of-thought reasoning · Mathematical reasoning datasetsaccuracyHurt
Replace code rationales with textual rationales (ablation)LLaMA-7B trained on mid-range-complexity data · AsDiv, GSM8K, MultiArith, and SVAMPaccuracyHurt
Filter Code Alpaca training data using CIRS rather than using the whole training setLLaMA-7B code generation model · Code Alpaca testaccuracy: 50.0 -> 55.0Helped

Surprising findings

Limitations

Experimental setup

Datasets: AQuA GSM8K MultiArith ASDiv SVAMP MATH BIG-Bench Hard Code Alpaca

Benchmarks: AsDiv GSM8K MultiArith SVAMP MATH (level-1 subset) BigBench-Hard (algorithmic and arithmetic subset)

Metrics: accuracy

Baselines: Falcon-7B-Instruct Vicuna-7B gpt-3.5-turbo Alpaca-7B Code-LLaMA-7B

Builds on: program-of-thought chain-of-thought Halstead complexity metrics McCabe cyclomatic complexity Code Alpaca

Closest papers by meaning

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.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy