atlas

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

Evaluating Program Semantics Reasoning with Type Inference in System $F$

NeurIPS 2025 · Large language models › Agents, code and math · approach: Execution-based code verification · 0 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.

Introduces TF-Bench, a benchmark of 188 Haskell type-inference tasks in System F (plus an NL-stripped variant TF-Bench-pure) to evaluate program semantics reasoning in LLMs, with robustness and reasoning-effectiveness metrics.

Problem

Existing code reasoning benchmarks cannot isolate whether LLMs reason about program semantics or exploit natural-language and identifier cues, and lack a formal deductive oracle.

Approach

Use type inference in System F/Haskell Prelude functions as an upstream reasoning task with verifiable alpha-equivalence oracle, and apply alpha-rewrites that remove NL types, type variables and binding names to create a purely semantic variant; propose Robustness Score and Reasoning Effectiveness metrics.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Remove natural-language elements with alpha-rewrite (ablation)evaluated LLMs · TF-Bench versus TF-Bench pureaccuracyHurt
Enable test-time compute reasoning (ablation)Claude-3.7-sonnet · TF-Benchaccuracy: 87.77 -> 90.42Helped
Enable test-time compute reasoning (ablation)Claude-3.7-sonnet · TF-Bench pureaccuracy: 46.81 -> 55.85Helped
Enable test-time compute reasoning (ablation)Gemini-2.5-flash · TF-Benchaccuracy: 78.19 -> 83.51Helped
Enable test-time compute reasoning (ablation)Gemini-2.5-flash · TF-Bench pureaccuracy: 30.32 -> 51.06Helped
Enable test-time compute reasoning (ablation)Qwen3-235B-FP8 · TF-Benchaccuracy: 80.49 -> 86.70Helped
Enable test-time compute reasoning (ablation)Qwen3-235B-FP8 · TF-Bench pureaccuracy: 35.64 -> 44.15Helped
Fine-tune on code (ablation)Qwen2.5-7B · TF-Benchaccuracy: 65.96 -> 61.17; decrease 4.79Hurt
Fine-tune on code (ablation)Codestral-22B (Mistral-22B) · TF-Bench pureaccuracy: 19.68 -> 11.17; decrease 8.51Hurt
Fine-tune on code (ablation)Qwen2.5-Coder-32B (Qwen2.5-32B) · TF-Bench pureaccuracy: 36.17 -> 31.91; decrease 4.26Hurt
Fine-tune on math (ablation)Mistral-7B and Qwen2-7B/72B · TF-Bench pureaccuracy: 7.99 -> 15.43; 3.19 -> 10.64; 21.81 -> 33.51Helped
Fine-tune on code (ablation)DeepSeek-V2-16B/236B · TF-Benchaccuracy: 29.79 -> 55.32; 38.30 -> 80.85Helped

Surprising findings

Limitations

Experimental setup

Datasets: Haskell Prelude (ghc-internal) functions

Benchmarks: TF-Bench TF-Bench-pure

Metrics: accuracy alpha-equivalence accuracy robustness score reasoning effectiveness

Baselines: Claude-3.7-sonnet GPT-O3 GPT-O1 DeepSeek-R1 Gemini-2.5-pro Qwen3-32B

Builds on: Hindley-Milner type inference System F Curry-Howard isomorphism

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