atlas

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

Can LLMs Implicitly Learn Numeric Parameter Constraints in Data Science APIs?

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

Empirically tests whether LLMs implicitly learn numeric parameter constraints of PyTorch and NumPy APIs across full-program, all-parameter, and single-parameter settings, and releases the DSEVAL benchmark of 19,600 SMT-verified problems.

Problem

Prior DS code generation work assumes LLMs implicitly model numeric parameter constraints in DS library APIs from training data, but this has not been systematically verified.

Approach

Generates controlled problems with SMT-encoded API constraints (via NNSmith) and validates LLM-predicted parameters with Z3, varying input rank and dimension magnitude to measure how accuracy degrades with difficulty, and packages the results as the DSEVAL benchmark.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Use GPT-4-Turbo instead of the strongest open-source modelLLM API-constraint prediction · DSEVAL PyTorch hardaccuracy: 39.2 -> 57.5Helped
Increase difficulty from easy to hardGPT-4-Turbo · DSEVAL PyTorchaccuracy: 77.2 -> 57.5Hurt
Increase difficulty from easy to hardGPT-4-Turbo · DSEVAL NumPyaccuracy: 95.3 -> 71.4Hurt
Use chain-of-thought prompting and prohibit groups=1GPT-4-Turbo on Conv2d · Conv2d groups prediction, input values up to 255accuracy: over 85%Helped
Use chain-of-thought promptingGPT-4-Turbo on Fold · PyTorch Fold, later difficulty settingsaccuracy: less than 5%Hurt
Remove reshape outputs that use the -1 inferred dimension (ablation)GPT-4-Turbo on PyTorch reshape · PyTorch reshape, individual parameter predictionaccuracyHurt
Increase the input-dimension value rangeLLMs predicting Conv2d groups · PyTorch Conv2d, hardest problemsaccuracy: ∼24%Hurt
Increase input rankLLMs predicting Fold k_size · PyTorch Foldaccuracy: nearly 0%Hurt

Surprising findings

Limitations

Experimental setup

Datasets: NNSmith constraint encodings DSEVAL

Benchmarks: DSEVAL custom full-program, all-parameter, and single-parameter settings on 28 PyTorch and NumPy APIs

Metrics: accuracy (validity) unique valid rate pass@1 diversity (Hellinger-based for fixed-set APIs)

Baselines: GPT-4-Turbo DeepSeek Coder CodeLlama StarCoder CodeQwen1.5

Builds on: NNSmith DS-1000 chain-of-thought ReAct

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