Technology

HistGramBench: Can AI Pass Mr. Dollhopf’s Geometry Class?

www.deerfieldfocalpoint.com/articles/histgrambench-can-ai-pass-mr-dollhopfs-geometry-class

A coloured geometric diagram from Oliver Byrne’s 1847 edition of Euclid: a right triangle with red, black and yellow-and-blue squares drawn on its sides.
OLIVER BYRNE, THE FIRST SIX BOOKS OF THE ELEMENTS OF EUCLID (1847), PUBLIC DOMAIN

You need to be able to sketch a triangle to pass Geometry Accelerated at Deerfield. Consider a hypothetical world where AI policies are non-existent. Should students trust an AI agent to read a geometry sketch and complete their geometry homework? Consider this problem from The Teaching of Geometry (1911): reproduce the semicircle and triangle shown in Figure 3a. Before an agent can solve a geometry problem, it needs to “see” the figure correctly and reconstruct it. One way to rebuild these figures is to redraw them as code. TikZ is a drawing language used with LaTeX, the standard typesetting in mathematics. A TikZ drawing is a short program that compiles the details of a figure so that a computer can read it. Today’s frontier AI models that read images, known as vision-language models, can write such programs from a picture1.

The problem is: how can the accuracy of a redrawn figure be objectively measured? The standard method compares pixels, but differences in line thickness can produce misleading results. Code-by-code comparison is impossible because historical diagrams do not have original code.

We introduce HistGramBench, a benchmark for evaluating how accurately AI models reconstruct historical geometry diagrams. It uses an alternative judging method that checks the facts a reader relies on: which points exist, which points lie on which shape, which lines are parallel to each other, etc. The benchmark seeks to answer a question: How much of a figure’s structure do AI models get right, and how often do they fail to produce a drawing at all?

Existing benchmarks that turn pictures into code use modern material that has original TikZ code: scientific figures in TikZ1, charts in Python8, and web pages in HTML7. These benchmarks grade an AI’s output on how similar the output looks compared to the answer key. HistGramBench’s foundation is built on Inter-GPS, which describes geometry diagrams as lists of objects and relationships6.

The figures come from public-domain historical articles (Figure 1). Each sample is a single figure cropped from its page. An automated check procedure and screening model are introduced to remove non-geometry crops and duplicates. Our final test set contains 2,507 crops from an original dataset of 411 books (Figure 2).

Mosaic of fifteen sample diagrams from the corpus, in three rows, each labelled with year, figure type and source. Row 1: 1560† Geometry, Proclus, In primum Euclidis (a few lines radiating from a point over printed text); 1636 Geometry, Ramus, The Way to Geometry (a large hand-lettered semicircle with C at the top and a and i at the ends); 1772 Geometry, Clairaut, Elementos de geometria (a parallelogram with a diagonal, lettered D, A, C, B, F, and 5); 1805 Geometry, Nattes's Practical Geometry (an ellipse inside a dotted circle with crossing dashed lines and letters); 1847 Geometry, The First Six Books of Euclid (a triangle in a circle with red, blue and yellow coloured parts). Row 2: 1856 Graph or plot, Elements of Analytical Geometry (a curve on axes against a dark background); 1872 Geometry, Nouv. Ann. Math., 1872 (lines from a point P crossing an oval); 1875 Relational schematic, Cremona, Géométrie projective (curved and straight lines with labelled points); 1885 Geometry, Halsted, Elements of Geometry (a prism); 1897 Geometry, Hardy, Elements of Analytic Geometry (an ellipse with axes X'X, and points P, F, A, E, D, D'). Row 3: 1909 Geometry, Archimedes, Geometrical Solutions (a circle in a square with Greek-letter labels); 1914† Number line or scale, Kiselyov, Elementary Geometry (two ruled scales, A and B); 1921† Mixed, Analytic Geometry, with Calculus (a circle and a sine wave on a grid); 1931† Table or grid, Schoenflies & Dehn, Analyt. Geometrie (a rectangle divided into numbered blocks). The three dagger-marked figures are not in the scored test set.
Figure 1. Sample of corpus figures, 1560–1931, with year, figure type and source. †: not in the scored test set. Harry Tran [10]
Three-panel pipeline diagram. Corpus: 411 books (1551–1933), detect figures, 17,113 figure crops, screen for clear diagrams, 5,444, remove near-duplicates, 3,682, split by source group, 3,000 test items, keep figures with a usable answer key, 2,507 scored items in 87 groups. Answer key: Writer 1 and Writer 2, align objects, cross-vote on every fact; facts both writers agree on are kept and facts they disagree on are dropped; kept facts are Objects 40%, Relations 44% and Labels 16%, 114,403 facts (mean 45.6 per figure). Scoring: a circle with points A and P, a TikZ program, compile once in a sandbox, a drawn circle with A and P (no drawing gives S = 0), read geometry, match objects to the answer key, then Geometric check 97.75% of facts and Judges 2.25% of facts, item score S, 87 group means, Benchmark score H. Two conditions: image only, image + page text.
Figure 2. HistGramBench pipeline. Left: corpus building. Centre: answer-key construction. Right: scoring one compiled answer. Harry Tran [10]

Each figure is given to each model in two ways (Table 1). In Track A, the model sees only the figure and is asked to redraw “the mathematical figure the original intended,” leaving out stains and printing flaws. In Track B, models receive additional captions and nearby text from the same page. In both tracks, the answer must be a single TikZ drawing. Comparison between Track A and Track B shows us to what degree context influences a model’s performance.

Each figure has an answer key: a list of facts of three kinds (Table 2). Entity facts say that an object exists (“there is a point”), relation facts say how objects connect (“Point A lies on the circle”), and label facts show how things are marked (“This point is printed as A”). The answer key avoids recording exact position or size.

Table 1: Task conditions. Page text is present for 1,538 of 2,507 items. Columns: (row label), Track A, Track B. Row Input: Track A, Figure crop; Track B, Figure crop, page text. Row Output: Track A, TikZ program; Track B, TikZ program. Row Invariant to: Track A, Translation, scale, line width, font, colour; Track B, Translation, scale, line width, font, colour.
Table 2: Answer-key fact classes (n = 114,403). D: drawing diagonal. 2.25% of facts are decided by the judge panel. Columns: Class, Example, Criterion, Share (%). Row Entity: point(P), circle(C); Present in drawing; 40. Row Relation: on(P, C), parallel(ℓ1, ℓ2); d ≤ 0.01 D; ∠ ≤ 1.5°; 44. Row Label: label(P, “A”); Exact string, bound to entity; 16.

Two self-contained AI models, GPT-6.1 Sol and Kimi K2.5, independently write down facts. Their lists are then lined up, and every fact in the combined list U is voted on. Writing a fact counts as a vote for it unless the writer later rejects it. With vw(f) standing for writer w’s vote on fact f, the key is:

K = { f ∈ U : v_1(f) = v_2(f) = support, f consistent, f unambiguous }.

So facts enter the key only when both writers agree. The rule also prefers a shorter, reliable key to an overly complete one. Figures with keys that are too thin or too uncertain are omitted from the test set.

The benchmark takes the TikZ code from the model’s answer and runs it on one attempt in a contained environment (Docker) and reads the output picture as a set of points, lines, curves and text (Figure 2, right). If the code fails to compile or contains forbidden commands, the output is considered a complete failure.

The objects in the key are first paired with objects in the drawing. Each fact is then checked by measuring the drawing. For instance, let d(p, x) be the distance from a point p to an object x, and let ∠(ℓ1, ℓ2) be the angle between two lines.

A point counts as lying on a circle when it sits within one percent of the drawing’s size from it. Two lines count as parallel when their directions differ by at most 1.5 degrees. The drawing’s size is independent of these criteria because distances are compared with the size of the whole drawing. The checking process is only dependent on written facts, so line thickness, font and colour do not make significant differences. Other relations such as right angles are checked with the same methodology. More complex facts such as shaded regions or marks showing equal lengths go to a third independent judge for further corroboration.

on(p, x) ⟺ d(p, x) ≤ εD,   parallel(ℓ_1, ℓ_2) ⟺ ∠(ℓ_1, ℓ_2) ≤ 1.5°,   ε = 0.01.

A model’s performance is measured mathematically. Let Ki be the answer key, Pi the facts reproduced, and Xi the facts excluded because a required object is missing. The set difference Ki ∖ Xi contains the checkable facts. Let gi equal 1 for a valid drawing and 0 for a compilation failure:

S_i = g_i · |P_i| / |K_i \ X_i|.

The corpus also contains books from adjacent authors so some figures tend to resemble each other. The benchmark tackles this by averaging scores within each group of related books and then averaging the groups:

H = (1/G) · Σ_{k=1}^{G} S̄_k,

where S̄k is the average score in group k and G = 87 is the number of groups. The 95 percent range around each result uses the 87 group averages as the sample3.

Six vision-language models were tested: Gemma 4 26B, Llama 4 Maverick, Ministral 3 14B, Gemma 4 E2B, Claude Haiku 4.5 and Nemotron Nano 12B v2. These models’ outputs shared the same configurations and the same limit on answer length.

Gemma 4 26B does best, with a Track A score of 0.59 (Table 3). Performance of Gemma 4 E2B and Claude Haiku 4.5 is in the same bound through sorting the six into five distinct levels2.

Many answers failed to compile: Of 2,507 Track A answers, Nemotron Nano 12B v2 ran out of answer length on 651, Llama 4 Maverick introduced forbidden commands on 292, and Claude Haiku 4.5 wrote code that failed with syntax errors on 1,218; in 1,007 cases it left out the line opening a LaTeX document. Models struggled the most with relations.

Adding page text does not have a significant influence on the overall performance of models. Individual models move both ways, with gains from Ministral 3 14B to a loss of 0.08 for Gemma 4 26B (Figure 5), and the five levels of Track A merge into two (Figure 4).

Seven semicircle diagrams. (a) Original, 1911: a semicircle on diameter A–B with a point D on the diameter, a point C on the arc, a solid vertical segment from C to D, and dashed segments from C to A and from C to B. Compiled drawings: (b) Gemma 4 26B, a semicircle with points A, D, B on the diameter, C on the arc, and segments C–D, C–A and C–B, the closest match; (c) Llama 4 Maverick, a triangle A–C–B with a vertical C–D and a separate arc to the right; (d) Ministral 3 14B, a semicircle with an angle arc marked θ and no labelled points A, B, C or D; (e) Gemma 4 E2B, a large semicircle with A, D, B, C, a dashed line from C to A and a dashed vertical from C to D; (f) Claude Haiku 4.5, a small semicircle with dots at A, D, B and C and segments from C to A, D and B; (g) Nemotron Nano 12B v2, an ellipse with C, A, D and B placed outside it and dashed lines, not resembling the original.
Figure 3. Worked example (Track A; The Teaching of Geometry, 1911; 40 facts). (a) Original crop. (b)–(g) Compiled drawings with S = found/checkable facts. Harry Tran [10]
Main results. Columns: Model; H Track A; H Track B; Track A Valid (%); Track A Recall Entity; Relation; Label. Gemma 4 26B: 0.589, 0.511, 72.7, 0.592, 0.538, 0.648 (all bold, best). Llama 4 Maverick: 0.524, 0.506, 70.4, 0.532, 0.427, 0.582 (all underlined, second). Ministral 3 14B: 0.391, 0.495, 70.4 (underlined, tied second), 0.509, 0.395, 0.533. Gemma 4 E2B: 0.309, 0.325, 60.2, 0.407, 0.332, 0.450. Claude Haiku 4.5: 0.300, 0.296, 50.8, 0.389, 0.317, 0.384. Nemotron Nano 12B v2: 0.197, 0.266, 51.0, 0.325, 0.235, 0.346. Pooled ΔH (B − A) = +0.015, 95% CI [−0.010, +0.040].
Table 3. Main results (N = 2,507 items; G = 87 source groups). H is the group-mean item score. Valid is the share of outputs yielding a drawing. Recall is shown by fact class. Bold: best; underline: second.

To see if ranking is dependent on the family of the AI Judges, each judge’s model family was removed in turn and the six models were reranked. There was no significant correlation between grading and model family.

Two 6 by 6 heatmaps of pairwise differences in H (row minus column) among Gemma 4 26B, Llama 4 Maverick, Ministral 3 14B, Gemma 4 E2B, Claude Haiku 4.5 and Nemotron Nano 12B v2, in that order. Left, Track A (image only). Lower triangle, differences: Llama vs Gemma 26B −0.07; Ministral vs Gemma 26B −0.20, vs Llama −0.13; Gemma E2B vs Gemma 26B −0.28, vs Llama −0.22, vs Ministral −0.08; Haiku vs Gemma 26B −0.29, vs Llama −0.22, vs Ministral −0.09, vs E2B −0.01; Nemotron vs Gemma 26B −0.39, vs Llama −0.33, vs Ministral −0.19, vs E2B −0.11, vs Haiku −0.10. Upper triangle, BH-adjusted p: Gemma 26B row: Llama 0.089*, Ministral <0.001*†, E2B <0.001*†, Haiku <0.001*†, Nemotron <0.001*†; Llama row: Ministral 0.007*, E2B <0.001*†, Haiku <0.001*†, Nemotron <0.001*†; Ministral row: E2B 0.024*, Haiku 0.027*, Nemotron <0.001*†; E2B row: Haiku 0.840, Nemotron <0.001*; Haiku row: Nemotron 0.008*. Right, Track B (image + page text). Lower triangle: Llama vs Gemma 26B −0.00; Ministral −0.02, −0.01; E2B −0.19, −0.18, −0.17; Haiku −0.21, −0.21, −0.20, −0.03; Nemotron −0.24, −0.24, −0.23, −0.06, −0.03. Upper triangle p: Gemma 26B row: Llama 0.916, Ministral 0.794, E2B <0.001*†, Haiku <0.001*†, Nemotron <0.001*†; Llama row: Ministral 0.825, E2B, Haiku and Nemotron all <0.001*†; Ministral row: E2B, Haiku and Nemotron all <0.001*†; E2B row: Haiku 0.522, Nemotron 0.110; Haiku row: Nemotron 0.522. Colour scale from −0.4 (dark orange) through 0 (white) to +0.4 (blue). Footer: upper triangle BH-adjusted p; * separated at FDR q = 0.10; † |difference| > δ* = 0.14.
Figure 4. Pairwise differences in H (row − column). Upper triangle: adjusted p. *: separated at FDR q = 0.10. †: |difference| > 0.14. Harry Tran [10]
Dot-and-interval chart of H (horizontal axis 0.0 to 0.7) for six models, with Track A (image only, grey) and Track B (image + page text, blue) points joined by a line, each with a 95% interval. Approximate values read from the chart: Gemma 4 26B, Track A 0.59 (interval about 0.53 to 0.65), Track B 0.51 (0.45 to 0.57); Llama 4 Maverick, A 0.52 (0.47 to 0.58), B 0.51 (0.45 to 0.56); Ministral 3 14B, A 0.39 (0.34 to 0.45), B 0.50 (0.44 to 0.55); Gemma 4 E2B, A 0.31 (0.26 to 0.36), B 0.33 (0.28 to 0.37); Claude Haiku 4.5, A 0.30 (0.24 to 0.36), B 0.30 (0.24 to 0.35); Nemotron Nano 12B v2, A 0.20 (0.15 to 0.24), B 0.27 (0.21 to 0.32). Exact point values are in Table 3.
Figure 5. H per model in Track A and Track B, with 95% intervals. Harry Tran [10]

So, can AI pass Mr. Dollhopf’s geometry class? Six frontier AI models surely did not, at least not yet. Even the best model gets a large part of each figure wrong, and many answers fail to produce drawings, which is like giving a blank page as a submission. Proprietary frontier models like Claude Haiku 4.5 still fail on fundamentals like leaving out the first line of code, equivalent to not signing the Honor Pledge on the test. If you use AI, whether your school’s policy allows it or not, you are setting yourself up to fail geometry class.

For engineers, the quickest step-improvement is configuring the model to produce a valid output. Most failures are mechanical, such as running out of answer length or breaking syntax. In model training, engineers should focus on training models to understand relations instead of just learning how to look at a figure and guess. Fact-level checks in this benchmark can serve as a framework for data that can be used in reinforcement learning. Additionally, researchers should be mindful of page text. It is dependent on individual models, so keeping image-only examples in training can help models learn to read the figure instead of over-relying on context and captions. Finally, bigger does not mean better. Gemma 4 26B, an open-sourced model by Google with only 26 billion parameters, performed better than a proprietary Claude model.

HistGramBench shows that current vision-language models have trouble redrawing historical geometry figures, especially in producing a drawing that adheres to syntax and relations. We hope HistGramBench will encourage work on models that read a figure’s geometry with higher precision and grounding from textbooks that are centuries old to a printed homework worksheet due on a Thursday.

Notes

  1. Belouadi, J., Ponzetto, S. P., & Eger, S. (2024). DeTikZify: Synthesizing graphics programs for scientific figures and sketches with TikZ. arXiv. https://doi.org/10.48550/arXiv.2405.15306 Back
  2. Benjamini, Y., & Hochberg, Y. (1995). Controlling the false discovery rate: A practical and powerful approach to multiple testing. Journal of the Royal Statistical Society: Series B (Methodological), 57(1), 289–300. https://doi.org/10.1111/j.2517-6161.1995.tb02031.x Back
  3. Ibragimov, R., & Müller, U. K. (2010). t-statistic based correlation and heterogeneity robust inference. Journal of Business & Economic Statistics, 28(4), 453–468. https://doi.org/10.1198/jbes.2009.08046 Back
  4. Levchenko, M. (2025). Evaluating LLMs for historical document OCR: A methodological framework for digital humanities. arXiv. https://doi.org/10.48550/arXiv.2510.06743 Back
  5. Lu, P., Bansal, H., Xia, T., Liu, J., Li, C., Hajishirzi, H., Cheng, H., Chang, K.-W., Galley, M., & Gao, J. (2023). MathVista: Evaluating mathematical reasoning of foundation models in visual contexts. arXiv. https://doi.org/10.48550/arXiv.2310.02255 Back
  6. Lu, P., Gong, R., Jiang, S., Qiu, L., Huang, S., Liang, X., & Zhu, S.-C. (2021). Inter-GPS: Interpretable geometry problem solving with formal language and symbolic reasoning. arXiv. https://doi.org/10.48550/arXiv.2105.04165 Back
  7. Si, C., Zhang, Y., Li, R., Yang, Z., Liu, R., & Yang, D. (2024). Design2Code: Benchmarking multimodal code generation for automated front-end engineering. arXiv. https://doi.org/10.48550/arXiv.2403.03163 Back
  8. Wu, C., Ge, Y., Guo, Q., Wang, J., Liang, Z., Lu, Z., Shan, Y., & Luo, P. (2024). Plot2Code: A comprehensive benchmark for evaluating multi-modal large language models in code generation from scientific plots. arXiv. https://doi.org/10.48550/arXiv.2405.07990 Back
  9. Zheng, L., Chiang, W.-L., Sheng, Y., Zhuang, S., Wu, Z., Zhuang, Y., Lin, Z., Li, Z., Li, D., Xing, E. P., Zhang, H., Gonzalez, J. E., & Stoica, I. (2023). Judging LLM-as-a-judge with MT-Bench and Chatbot Arena. arXiv. https://doi.org/10.48550/arXiv.2306.05685 Back
  10. Tran, H. (n.d.). HistGramBench: Can AI pass Mr. Dollhopf’s geometry class?. Deerfield Academy. Figure 1 reproduces historical diagrams identified in the figure; Figures 2–5 and Tables 1–3 present the author’s benchmark design and results. Back

Harry Tran ’28