# Prompt Less, Infer More: Static Analysis-Guided LLM Type Annotation for Python

DevFeed: [Prompt Less, Infer More: Static Analysis-Guided LLM Type Annotation for Python](<https://devfeed.tech/articles/prompt-less-infer-more-static-analysis-guided-llm-type-annotation-for-python-112679.md>)

Original publisher: [Read original article](<https://arxiv.org/abs/2610.41617>)

Author: Wonseok Oh, Michael Pradel, Hakjoo Oh

Published: 2026-11-02T05:00:00Z

Content type: article

Language: en

Sources: [arXiv: Software Engineering](<https://devfeed.tech/sources/arxiv-software-engineering.md>)

Topics: [data type](<https://devfeed.tech/topics/data-type.md>), [Static code analysis](<https://devfeed.tech/topics/static-code-analysis.md>), [Python](<https://devfeed.tech/topics/python.md>), [Large Language Model](<https://devfeed.tech/topics/llm.md>)

Tags: [abstract](<https://devfeed.tech/tags/abstract.md>), [annotation](<https://devfeed.tech/tags/annotation.md>), [annotations](<https://devfeed.tech/tags/annotations.md>), [arxiv](<https://devfeed.tech/tags/arxiv.md>), [coding-assistant](<https://devfeed.tech/tags/coding-assistant.md>), [context](<https://devfeed.tech/tags/context.md>), [cost](<https://devfeed.tech/tags/cost.md>), [cost-savings](<https://devfeed.tech/tags/cost-savings.md>), [cs-se](<https://devfeed.tech/tags/cs-se.md>), [efficiency](<https://devfeed.tech/tags/efficiency.md>), [exploit](<https://devfeed.tech/tags/exploit.md>), [frontier](<https://devfeed.tech/tags/frontier.md>), [frontier-model](<https://devfeed.tech/tags/frontier-model.md>), [gpt](<https://devfeed.tech/tags/gpt.md>), [gpt-5-5](<https://devfeed.tech/tags/gpt-5-5.md>), [inference](<https://devfeed.tech/tags/inference.md>), [llm](<https://devfeed.tech/tags/llm.md>), [prompt](<https://devfeed.tech/tags/prompt.md>), [python](<https://devfeed.tech/tags/python.md>), [static-analysis](<https://devfeed.tech/tags/static-analysis.md>), [type](<https://devfeed.tech/tags/type.md>)

## AI overview

SALT combines static analysis with LLM inference to annotate missing Python types: it resolves some types statically, prioritizes which cases need LLM queries, and supplies concise type-aware context. In evaluations on 12 real-world Python projects, it achieved the best accuracy among the systems evaluated and reduced estimated LLM costs by up to 78.5% versus a strong coding-assistant baseline. The abstract reports similar cost savings with GPT-5.5; it does not provide specific accuracy figures or further evaluation details.

## Source excerpt

arXiv:2610.41617v1 Announce Type: new Abstract: Type annotations improve the maintainability and reliability of Python programs, but many real-world projects remain under-annotated because manual annotation is time-consuming and error-prone. Recent neural and LLM-based type inference systems can recover missing annotations, yet they often trade accuracy for efficiency. Existing approaches often fail to exploit project-wide type evidence, or do so inefficiently through unnecessary model calls and noisy prompts. We present SALT, an LLM-based type inference system guided by static analysis. SALT integrates static analysis with LLM inference to resolve types statically, prioritize LLM queries, and construct concise type-aware context. To demonstrate the effectiveness of SALT, we evaluated it on 12 real-world Python projects. SALT achieves the best accuracy among the evaluated systems and reduces estimated LLM cost by up to 78.5% compared with a strong coding-assistant baseline. It also shows similar cost savings with the frontier model GPT-5.5, demonstrating that SALT remains effective with strong LLMs.