ELVIA analysis of: TypyBench: Evaluating LLM Type Inference for Untyped Python Repositories
Original paper: Honghua Dong; Jiacheng Yang; Xun Deng; Yuhe Jiang; Gennady Pekhimenko; Fan Long; Xujie Si. TypyBench: Evaluating LLM Type Inference for Untyped Python Repositories. Proceedings of the 42nd International Conference on Machine Learning, vol. 267, 2025. https://proceedings.mlr.press/v267/dong25l.html
Source version: Published ICML 2025 proceedings PDF (PMLR 267)
Source location: PDF pp.5,7; Figs.1,9-10 and p.14 prompts; released repo_similarity.py:get_repo_similarity, helpers.py:get_type_dict_from_repo, evaluation.py:evaluate, Dockerfile entry point.
PDF p.4; released type_similarity.py:get_type_attributes,_get_type_info_similarity,get_type_similarity
scripts/evaluation.py:evaluate cache load and cache save blocks, CSV overall_score_wo_missing_exact output
Question: What does the recorded analysis establish about “TypyBench: Evaluating LLM Type Inference for Untyped Python Repositories”?
Bounded finding:
Core TypeCheck interpretation does not distinguish stub declaration consistency from compatibility with unchanged implementation. Two bounded released-code defects affect inherited attribute similarity and cache-reloaded exact-match scalar. Supplementary aggregate arithmetic agrees with printed main results.
Recorded check:
Existing findings, counterevidence and bounded classifications; no scientific reassessment performed during import.
Complete public transcription of the retained report, with internal workflow identifiers and host paths omitted.
Case-wide limitations:
- Stub-only checker counts omit original implementation obligations — Counterevidence: Stubs retain useful declaration/import/inheritance checks. Missing-rate is also reported. Neither addresses the complete-signature counterexample. Historical prediction directory contents/experiment commit are not supplied, so historical rankings are not declared reversed.
- Local symbol names do not equal supported inherited operations — Counterevidence: A declaration-only similarity is mathematically coherent but differs from the paper's stated supported-operation semantics. Paper's experiment environment was Mypy1.11.1; no exact-environment empirical rerun claimed.
- Cached exact-match-without-missing loads the TypeSim key — Counterevidence: Fresh computation/saved exact field is correct. Exact-match depth arrays are loaded separately. Historical usage of faulty cached scalar is unknown.
- Limitations: Historical experiment commit and prediction folders not verified
- Limitations: No author code, dataset, model APIs or empirical benchmark rerun
- Limitations: Independent synthetic mypy tests used1.14.1/Python3.13.5 versus paper1.11.1/Python3.12
- Limitations: Separate OpenReview attachment unavailable (403 acquisition)
- Limitations: Source plots checked through extracted context and numerical tables; parent inspects rendered key pages
- Limitations: Completed by parent; see provenance execution_facts.compile and visual_qa.
- The original report's complete scope, counterevidence and unresolved questions are retained below.
- This import checks publication format and identity; it does not repeat scientific review.
- Independent human scientific review is pending; author adoption has not been requested.
Original source excerpts (verbatim):
We then use the Jaccard index to measure functional similarity, where two types are similar if they share most of the same methods and operations.
Source: Published ICML 2025 proceedings PDF (PMLR 267)
Locator: PDF p. 4
Source PDF SHA-256: cedd43736ab0bfe6fc28e917e93aab07e1f8aec4353c01f8a0ef7d6aa9c868bc
Review status: Independent review pending
Case: icml2025-0197-typybench-evaluating-llm-type-inference-for-untyped-python-reposit
Revision: 1
Record created: 2026-10-26T04:21:21.357774+00:00
Permalink: https://elvia-atlas.org/atlas/cases/icml2025-0197-typybench-evaluating-llm-type-inference-for-untyped-python-reposit.html
Versioned public record: https://elvia-atlas.org/atlas/evidence/icml2025-0197-typybench-evaluating-llm-type-inference-for-untyped-python-reposit/records/icml2025-0197-typybench-evaluating-llm-type-inference-for-untyped-python-reposit.r1.json
Canonical record SHA-256: 8dd416ef88cd70afe40888b9f481e1af97152200e21f6b3be66bbb2829763136
The page follows the latest revision; the versioned record identifies this snapshot.
Analysis citation:
Minhao Liu. ELVIA analysis of: TypyBench: Evaluating LLM Type Inference for Untyped Python Repositories. ELVIA, 2026. https://elvia-atlas.org/atlas/cases/icml2025-0197-typybench-evaluating-llm-type-inference-for-untyped-python-reposit.html
Case icml2025-0197-typybench-evaluating-llm-type-inference-for-untyped-python-reposit; revision 1; Independent review pending. Assessment is limited to the inspected claims. Versioned record: https://elvia-atlas.org/atlas/evidence/icml2025-0197-typybench-evaluating-llm-type-inference-for-untyped-python-reposit/records/icml2025-0197-typybench-evaluating-llm-type-inference-for-untyped-python-reposit.r1.json
Recorded claims and inspection subjects:
Section 4.2 motivates TypeCheck as detecting incompatibility of predicted return/argument types at use sites; Section 6.2 compares predicted error counts with original-repository 141.8 errors as evidence of consistency.
Section4.1.1 uses supported methods/operations for the base Jaccard score.
Released evaluator exports separate TypeSim and exact-match fields for all and nonmissing cases.
Recorded domain:
Completed report for I25-43566; exact inspected scope and limitations are retained in the report and coverage ledger.
Recorded assumptions:
Complete syntactically valid predicted stub signatures
Explicit ordinary primitive types, no Any
Original function implementations and call sites fixed
Separate original/prediction checker inputs, as in released dataflow
Two distinct named ordinary classes
Child inherits Base.read unchanged and adds nothing
No generics, union, Any, or overrides
Supported operations include inherited methods
Existing cache has both scalar fields
TypeSim and exact scores differ
Cache branch executed
Recorded dependencies:
Actual review scope:
Completed report for I25-43566; exact inspected scope and limitations are retained in the report and coverage ledger.
Evidence and counterevidence:
retained-findings (support; Formatting-only transcription of the selected completed report.): Existing findings, counterevidence and bounded classifications; no scientific reassessment performed during import.
retained-report (support; LaTeX parsed as data; no author code or TeX execution.): Complete public transcription of the retained report, with internal workflow identifiers and host paths omitted.
scope-and-rebuttal (rebuttal; Public copy of the archived coverage ledger.): Existing inspection coverage, counterevidence, missing materials and unresolved scope remain as supplied.
editable-latex (support; Formatting conversion only; original archive bytes remain unchanged.): Public editable report generated from the same retained transcription.
Displayed problem statements:
Source finding p1: Stub-only checker counts omit original implementation obligations
For two base types the paper defines a Jaccard similarity of supported attribute sets after excluding common `object` operations. Ordered generic arguments are averaged positionwise and normalized by the larger arity; union members use a maximum-weight matching, again normalized by the larger cardinality. The root and argument contributions are averaged. These operations yield scores in \([0,1]\) when the base score does, handle unequal arities as specified, and are symmetric. The published example \[S(\mathrm{List[int]},\mathrm{Sequence[float]})
=\tfrac12(0.7+0.6)=0.65\] is arithmetically correct. A partial-match score is a similarity heuristic, not a proof of type substitutability; this distinction alone is not counted as a defect.
The supplementary Tables 9–17 contain 50 rows per model, with 47 finite TypeCheck entries. Recomputed TypeCheck means include \(366.0213\) for GPT-4o, \(127.1277\) for Claude-3.5-Sonnet, and \(214.6170\) for DeepSeek-V3; these agree with Table 2 at its printed precision. The corresponding TypeSim means are \(0.80448\), \(0.78762\), and \(0.79468\). This is a check of published arithmetic, not a replication of the measurements. The three unavailable checker runs are disclosed in Table 6, rather than silently treated as zero.
Section 4.2 (p. 5) motivates TypeCheck using inconsistencies such as a predicted return type being incompatible with its uses, and interprets counted errors as obstacles to practical use. Section 6.2 (p. 7) compares model error counts with the original repository average of \(141.8\) and interprets a lower count as stronger consistency. The abstract and conclusion make repository-wide consistency a central contribution.
The released dataflow is decisive. `run.py` mounts the prediction directory. The Docker entry point invokes |scripts/evaluation.py| with that directory. Its `evaluate` function calls |get_repo_similarity(original_repo,prediction_directory)|. In `repo_similarity.py`, the original and prediction directories are passed separately to |get_type_dict_from_repo|. In `helpers.py`, that function copies each input program’s own files to a temporary directory and calls Mypy’s builder. No step inserts predicted signatures into the original function bodies or recreates their call sites. The predictions requested on pp. 7 and 14 are `.pyi` stub files. Ordinary stub files contain signatures but elide implementation logic [mypy].
Consequently the procedure compares \[E(P_{\mathrm{original}})\quad\hbox{with}\quad
E(S_{\mathrm{predicted}}),\] where \(E\) is the selected error count and \(S\) is a stub program. To evaluate compatibility of predicted types with the original uses, the required object is instead \[E\!\left(P_{\mathrm{original}}[
\text{predicted annotations}]\right).\] These quantities need not agree even for complete, syntactically valid predictions.
Complete syntactically valid predicted stub signatures. Explicit ordinary primitive types, no Any. Original function implementations and call sites fixed. Separate original/prediction checker inputs, as in released dataflow.
Source finding p2: Local symbol names do not equal supported inherited operations
For two base types the paper defines a Jaccard similarity of supported attribute sets after excluding common `object` operations. Ordered generic arguments are averaged positionwise and normalized by the larger arity; union members use a maximum-weight matching, again normalized by the larger cardinality. The root and argument contributions are averaged. These operations yield scores in \([0,1]\) when the base score does, handle unequal arities as specified, and are symmetric. The published example \[S(\mathrm{List[int]},\mathrm{Sequence[float]})
=\tfrac12(0.7+0.6)=0.65\] is arithmetically correct. A partial-match score is a similarity heuristic, not a proof of type substitutability; this distinction alone is not counted as a defect.
The supplementary Tables 9–17 contain 50 rows per model, with 47 finite TypeCheck entries. Recomputed TypeCheck means include \(366.0213\) for GPT-4o, \(127.1277\) for Claude-3.5-Sonnet, and \(214.6170\) for DeepSeek-V3; these agree with Table 2 at its printed precision. The corresponding TypeSim means are \(0.80448\), \(0.78762\), and \(0.79468\). This is a check of published arithmetic, not a replication of the measurements. The three unavailable checker runs are disclosed in Table 6, rather than silently treated as zero.
Section4.1.1 uses supported methods/operations for the base Jaccard score.
Two distinct named ordinary classes. Child inherits Base.read unchanged and adds nothing. No generics, union, Any, or overrides. Supported operations include inherited methods.
Source finding p3: Cached exact-match-without-missing loads the TypeSim key
For two base types the paper defines a Jaccard similarity of supported attribute sets after excluding common `object` operations. Ordered generic arguments are averaged positionwise and normalized by the larger arity; union members use a maximum-weight matching, again normalized by the larger cardinality. The root and argument contributions are averaged. These operations yield scores in \([0,1]\) when the base score does, handle unequal arities as specified, and are symmetric. The published example \[S(\mathrm{List[int]},\mathrm{Sequence[float]})
=\tfrac12(0.7+0.6)=0.65\] is arithmetically correct. A partial-match score is a similarity heuristic, not a proof of type substitutability; this distinction alone is not counted as a defect.
The supplementary Tables 9–17 contain 50 rows per model, with 47 finite TypeCheck entries. Recomputed TypeCheck means include \(366.0213\) for GPT-4o, \(127.1277\) for Claude-3.5-Sonnet, and \(214.6170\) for DeepSeek-V3; these agree with Table 2 at its printed precision. The corresponding TypeSim means are \(0.80448\), \(0.78762\), and \(0.79468\). This is a check of published arithmetic, not a replication of the measurements. The three unavailable checker runs are disclosed in Table 6, rather than silently treated as zero.
Released evaluator exports separate TypeSim and exact-match fields for all and nonmissing cases.
Existing cache has both scalar fields. TypeSim and exact scores differ. Cache branch executed.
Complete retained report:
Abstract: This initial review examines the published proceedings paper, its embedded appendices, and the pinned released evaluation code. A major methodological problem affects the interpretation of TypeCheck: the released procedure checks predicted stub programs separately from original implementations, so the two error counts do not test the same program obligations. An independent, fully typed example passes as a predicted stub yet produces an argument-type error when its predictions are applied to the unchanged implementation. Two local implementation defects concern inherited attributes in TypeSim and an exact-match cache field. The printed model-level arithmetic is reproducible from the supplementary tables. These results establish defects in the evaluated objects and released implementation; they do not determine revised model rankings or identify the code commit used in the historical experiments.
Date: 24 October 2026
Title: Scientific review of TypyBench:
evaluation semantics and implementation checks
# Identity, version, and scope
The reviewed paper is Honghua Dong, Jiacheng Yang, Xun Deng, Yuhe Jiang, Gennady Pekhimenko, Fan Long, and Xujie Si, TypyBench: Evaluating LLM Type Inference for Untyped Python Repositories, ICML 2025, PMLR 267, paper identifier I25-43566 (local number 0197), OpenReview identifier `xl9sv9vEDy` [paper]. All page references below are one-based pages of the 28-page proceedings PDF, including appendices. The original PDF SHA-256 is
cedd43736ab0bfe6fc28e917e93aab07
e1f8aec4353c01f8a0ef7d6aa9c868bc.
The released repository was inspected statically at commit |51feed13381f6bd027caad1f5bf7c4de798bc6a5| [code]. Its acquisition record explicitly does not identify it as the historical experiment commit.
The review covers Sections 1–7, Algorithms 1–4, the metric definitions, data selection and cleaning, Tables 1–4, Appendix A–D, and the evaluation path through `run.py`, `Dockerfile`, |scripts/evaluation.py|, `repo_similarity.py`, `type_similarity.py`, and `helpers.py`. The benchmark’s separate repository dataset and raw model generations were not acquired or executed. Separate OpenReview supplementary attachments remain unavailable in the acquisition record (HTTP 403); the embedded appendices were read. No author code, Docker build, model API, or historical experiment was executed.
# Definitions and positive checks
For two base types the paper defines a Jaccard similarity of supported attribute sets after excluding common `object` operations. Ordered generic arguments are averaged positionwise and normalized by the larger arity; union members use a maximum-weight matching, again normalized by the larger cardinality. The root and argument contributions are averaged. These operations yield scores in \([0,1]\) when the base score does, handle unequal arities as specified, and are symmetric. The published example \[S(\mathrm{List[int]},\mathrm{Sequence[float]})
=\tfrac12(0.7+0.6)=0.65\] is arithmetically correct. A partial-match score is a similarity heuristic, not a proof of type substitutability; this distinction alone is not counted as a defect.
The supplementary Tables 9–17 contain 50 rows per model, with 47 finite TypeCheck entries. Recomputed TypeCheck means include \(366.0213\) for GPT-4o, \(127.1277\) for Claude-3.5-Sonnet, and \(214.6170\) for DeepSeek-V3; these agree with Table 2 at its printed precision. The corresponding TypeSim means are \(0.80448\), \(0.78762\), and \(0.79468\). This is a check of published arithmetic, not a replication of the measurements. The three unavailable checker runs are disclosed in Table 6, rather than silently treated as zero.
The temporal contamination analysis on pp. 8–9 is presented as a potential explanation. Repository age is confounded with repository characteristics and model training exposure, so the plot is not a causal contamination estimate; the paper’s qualified wording does not establish a separate error. Likewise, the full-repository experiment uses only three eligible repositories, which bounds its generality without falsifying those observations.
# Problem 1: stub-only errors do not measure consistency with implementations
## Claim and operative procedure
Section 4.2 (p. 5) motivates TypeCheck using inconsistencies such as a predicted return type being incompatible with its uses, and interprets counted errors as obstacles to practical use. Section 6.2 (p. 7) compares model error counts with the original repository average of \(141.8\) and interprets a lower count as stronger consistency. The abstract and conclusion make repository-wide consistency a central contribution.
The released dataflow is decisive. `run.py` mounts the prediction directory. The Docker entry point invokes |scripts/evaluation.py| with that directory. Its `evaluate` function calls |get_repo_similarity(original_repo,prediction_directory)|. In `repo_similarity.py`, the original and prediction directories are passed separately to |get_type_dict_from_repo|. In `helpers.py`, that function copies each input program’s own files to a temporary directory and calls Mypy’s builder. No step inserts predicted signatures into the original function bodies or recreates their call sites. The predictions requested on pp. 7 and 14 are `.pyi` stub files. Ordinary stub files contain signatures but elide implementation logic [mypy].
Consequently the procedure compares \[E(P_{\mathrm{original}})\quad\hbox{with}\quad
E(S_{\mathrm{predicted}}),\] where \(E\) is the selected error count and \(S\) is a stub program. To evaluate compatibility of predicted types with the original uses, the required object is instead \[E\!\left(P_{\mathrm{original}}[
\text{predicted annotations}]\right).\] These quantities need not agree even for complete, syntactically valid predictions.
## Complete counterexample and observed check
Consider this original implementation:
Code:
def f() -> int:
return 1
def h(x: int) -> int:
return x
def g() -> int:
return h(f())
Predict precisely these three signatures:
Code:
def f() -> str: ...
def h(x: int) -> int: ...
def g() -> int: ...
All functions are present; all parameters and returns use ordinary explicit primitive types; there is no `Any`, missing file, syntax error, external dependency, overload, dynamic dispatch, or untyped body. Thus neither missing predictions nor gradual-typing escape hatches explain the discrepancy. This is a counterexample to the metric’s interpretation, not a claimed member of the curated 50-repository dataset.
The predicted stub is internally type-correct. Applying its signatures to the original bodies instead changes only the return annotation of `f`. The literal return value \(1\) is an `int`, contradicting the predicted `str`; moreover `h(f())` supplies a declared `str` to a required `int` argument. The latter is an `arg-type` error, explicitly included in Appendix C.2.
An independently written fixture was checked with the already installed Mypy 1.14.1 and Python 3.13.5. The original implementation produced zero errors; the predicted stub produced zero errors; the reannotated implementation produced two errors, `return-value` and `arg-type`. This is an actual finite diagnostic on new reviewer-written programs, not execution of the authors’ evaluator. The paper reports Mypy 1.11.1/Python 3.12, so this run is not claimed to reproduce that environment. The structural argument does not depend on a version-specific diagnostic: the predicted stub contains none of the original return or call expressions.
## Counterevidence, impact, and correction boundary
Stub checking can detect genuine inconsistencies in declarations, inheritance, and imports. It is useful for interface validation. The paper also reports missing rates, which provide information beyond the raw error count. These facts do not make the stub-only count a test of implementation compatibility: the counterexample has complete signatures and no missing files.
A separate possibility is that historical prediction folders contained transformed implementations in addition to stubs. No supplied raw prediction artifacts establish that, and the released pipeline does not perform such transformation. The report therefore does not assert that every published model score was generated by this commit, or that any ranking reverses. It establishes that the described/released evaluation does not support the broad interpretation placed on TypeCheck, and that the direct model-versus-original comparison changes the set of checked program obligations.
Assessment: Major. Repository-level consistency is a principal benchmark contribution and a central empirical conclusion. Losing the original usage constraints materially affects that measurement, even if TypeSim and the qualitative need for better type inference remain useful. A defensible repair is to apply predictions to a fixed implementation/caller corpus and count the same checks for every model, reporting parse/annotation failures separately. That repair design is logically targeted; its effects on the published benchmark require a fresh evaluation and are not verified here.
# Problem 2: supported operations are replaced by locally declared names
Section 4.1.1 (p. 4) defines base similarity using supported methods and operations. The released |get_type_attributes| returns `TypeInfo.names`, a class’s local symbol table, without traversing its method-resolution order. Consider
Code:
class Base:
def read(self) -> int:
return 1
class Child(Base):
pass
Both types support the same inherited operation `read`; the subclass neither adds nor overrides behavior. Excluding common `object` operations, the intended supported-operation sets are both \(\{\mathrm{read}\}\) and their Jaccard score is \(1\). In the independently checked Mypy representation, the local names are respectively \(\{\mathrm{read}\}\) and \(\varnothing\). The released formula on those sets yields \[1-\frac{|\{\mathrm{read}\}\triangle\varnothing|}
{|\{\mathrm{read}\}\cap\varnothing\setminus O|
+|\{\mathrm{read}\}\triangle\varnothing|}=0,\] where \(O\) is the excluded common-operation set. The string-equality shortcut in |get_type_similarity| does not apply because the two named classes differ. The independent fixture confirms equal effective MRO attribute sets but a local-name score of zero.
An alternative definition based strictly on declarations would make the calculation internally coherent, but would not be the paper’s stated supported-operation definition. Method-name overlap also omits signatures and effects; that separate design limitation is not needed for this counterexample. Assessment: Minor for the demonstrated bounded implementation discrepancy. The extent to which inherited user-defined classes contributed to the historical aggregate scores is not established. Computing effective supported attribute sets would address this specific mismatch; complete semantic similarity and historical numerical recovery are not thereby verified.
# Problem 3: cache reload substitutes TypeSim for exact match
In |scripts/evaluation.py|, `evaluate` saves both |repo_overall_score_wo_missing| and |repo_overall_score_wo_missing_exact|. On a cache hit, however, the variable for the latter is assigned the former dictionary key. The resulting CSV and printed exact-match-without-missing output can change merely because the evaluation is repeated.
For a cache containing TypeSim-without-missing \(u=0.9\) and exact-match-without-missing \(v=0.6\), a cold evaluation correctly stores \(v\), whereas the reload branch assigns \(u\) to the exact field. Its absolute error is \(0.3\). The example needs only a valid cache containing the separately computed fields with \(u\ne v\); the same synthetic score pair is permitted by a partial-credit metric versus exact matching. No author pickle was loaded and no author function was executed.
The cold branch calculates and saves the correct field; the defect is specifically the reload branch. The published main exact-match-by-depth results do not automatically inherit this error, since their depth dictionaries are loaded separately. Assessment: Minor. Replacing the lookup with the exact-match key repairs this local dataflow, but no full author evaluation was rerun and no claim is made that the published tables used the faulty cached scalar.
# Dependence, conclusions, and remaining work
The strongest supported concern is the interpretation and implementation of the core consistency metric. The inherited-attribute and cache findings affect distinct parts of the released evaluation, with narrower demonstrated scope. None of these results justifies fabricating corrected benchmark scores. The basic TypeSim recurrence and the checked supplementary aggregate arithmetic survive these checks.
Issue | Assessment | Repair verification | Remaining work
Stub/implementation mismatch | Major | Targeted design stated; benchmark repair untested | Fixed-program re-evaluation
Inherited attributes | Minor | Counterexample verified; complete repair untested | MRO-aware implementation and score audit
Exact-match cache key | Minor | Local key correction analytically sufficient | Cold/cache regression check
All scientific adjudications remain pending. Human reviews are empty. Author adoption has not been requested. This newly created initial review has not undergone the separate independent acceptance stage.
# Supporting checks
The primary evidence is the frozen PDF and pinned repository. Relevant function anchors are |helpers.py:get_type_dict_from_repo,filter_errors|, |repo_similarity.py:get_repo_similarity|, |type_similarity.py:get_type_attributes,get_type_similarity|, and |scripts/evaluation.py:evaluate|. The latter’s cache assignments and CSV output were traced together, rather than judged from an isolated line.
The command was the existing `[local archive path omitted] running that independent script. The author package was never imported. The script checks newly written fixtures through Mypy and records its actual version, outputs, return codes, and fixture hashes. All author source files remained read-only.
The original PDF was read through the existing Poppler `pdftotext` executable in two page ranges, 1–10 and 11–28. The saved source text was used as a cross-reference. Extracted numerical tables were parsed and their means independently calculated; no raster-only plotted values were inferred from garbled text extraction. Source pages 5 and 7 were rendered.
Prior recovery metadata was preserved once as history and was not counted as this new scientific review.
9 H. Dong et al., TypyBench: Evaluating LLM Type Inference for Untyped Python Repositories, PMLR 267 (2025), proceedings version. https://proceedings.mlr.press/v267/dong25l.html. TypyBench authors, released evaluation repository, commit |51feed13381f6bd027caad1f5bf7c4de798bc6a5|. https://github.com/typybench/typybench. Mypy documentation, Stub files, accessed 24 October 2026. The accessed stable documentation reports version 2.4.0; it is used only for the documented distinction between interfaces and implementations. https://mypy.readthedocs.io/en/stable/stubs.html.
Source PDF SHA-256: cedd43736ab0bfe6fc28e917e93aab07e1f8aec4353c01f8a0ef7d6aa9c868bc
Repair verification: pending
Author adoption: not_requested