DigestAI news desk

Cut through the AI noise.

Research

Study probes if LMs understand variable roles via SAEs

Researchers from arXiv cs.CL published a study titled "Do LMs Know What Variables Do?" to investigate whether large language models (LLMs) truly understand the functional roles of variables in code. The team used Sajaniemi's taxonomy to define eleven recurring variable behaviors, such as accumulation and traversal, and built a corpus of 126,926 natural-code files across five programming…

1 source primary source

Key points

  • Study analyzes 126,926 code files across five languages to test LLM understanding of variable roles.
  • Residual probes outperform individual SAE features in recovering variable role distinctions.
  • Interventions to change variable roles during generation often reduce code correctness.

The study employed sparse autoencoders (SAEs) to analyze model representations. Results showed that residual probes were more effective than individual SAE features or lexical baselines at recovering role distinctions, though performance dropped slightly when variable names were changed. While combining SAE features improved accuracy, the models remained sensitive to role-changing edits.

A key finding is that high ranking accuracy often came with frequent false positives. During code generation, interventions aimed at changing variable roles frequently compromised code correctness. Changes that passed tests did not show a clear advantage over random controls, suggesting that current models may not reliably control variable roles without breaking functionality.

Read the original at arXiv cs.CL · by C\'elian Vasson, Daniil Ognev, Kentaro Inui, Benjamin Heinzerling primary sourceOpen source ↗
Topics · follow one to build your own front page
Sajaniemi

The headline, key points and digest above were generated by Digest AI's editorial model from the linked sources. Automated summaries can contain errors: the sources are the record. Spotted a mistake? Tell us. Published by Martin K., who runs Digest AI and handles corrections.

Comments

via GitHub Discussions

More in Research

All →

Related stories