16  The final results

You will learn:

Every chapter so far reported the validation split, the one the book’s choices were made on. This chapter is the only one that uses the development split. Its conversations were set aside at the start (Chapter 2), and its gold programs were used only to test code that has no model in it. A model’s outputs on them were not scored, and not read, until the decisions below were written down.

16.1 What was fixed first

Before any output was scored on the development split, the decisions of the book were written into the project’s plan (PLAN.md), with the commit they were made at, and a file was created whose existence is what lets the development evaluations run (the builders refuse the split until it exists, and a test fails if any chapter before this one asks for it). From then on the rule was that nothing changes because of a development number, except a bug, and a disappointing result is reported and not fixed. The decisions were:

  • The model and its training. The adapter of Chapter 12: rank 16, trained for two epochs on the train-fit conversations, with the checkpoint of the lowest validation loss, and seed 0. The rank sweep of Chapter 17 is a validation experiment and chose nothing.
  • The untuned model’s prompt. The variant that the rule of Section 11.4.2 chose on validation, e3p (a plain system message and three examples, example set 0), and e0p, the prompt the fine-tuned model is trained with.
  • The output format. The DSL of Chapter 3, with greedy decoding, no grammar, and one attempt per turn; an invalid output counts as wrong (Chapter 13).
  • The measures. Execution accuracy in both histories, with the predicted history as the headline; program accuracy next to it; a paired bootstrap that resamples whole report pages.

Six generation runs were then made, each once: the fine-tuned model, the untuned model with e3p and the untuned model with e0p, each with the predicted history and with the gold history. The scores below are computed from them.

16.2 The rule for more seeds

The fine-tuned model was trained once. Greedy decoding is deterministic, so the only noise that a second run would add is the training’s: the initialisation, the order of the data, the dropout. The book fixed in advance when that noise would be measured: if the paired interval of the fine-tuned model against either untuned system includes zero, in either history, two more training seeds are trained and scored on the same split, and the results are reported as a mean and a spread. The rule is checked below, after the table.

16.3 Results on the development split

Code
#HEAVY
import matplotlib.pyplot as plt
import pandas as pd

from convfinqa.artifacts import get
from convfinqa.data.splits import page_group
from convfinqa.stats import bootstrap_accuracy, paired_difference

RUNS_DEV = {
    ("untuned, e0p", "predicted"): "scores_untuned_dev_e0p_0_pred",
    ("untuned, e0p", "gold"): "scores_untuned_dev_e0p_0_gold",
    ("untuned, e3p", "predicted"): "scores_untuned_dev_e3p_0_pred",
    ("untuned, e3p", "gold"): "scores_untuned_dev_e3p_0_gold",
    ("fine-tuned", "predicted"): "scores_tuned_dev_main_0_pred",
    ("fine-tuned", "gold"): "scores_tuned_dev_main_0_gold",
}
SCORES = {
    ("untuned, e0p", "predicted"): get("scores_untuned_dev_e0p_0_pred"),
    ("untuned, e0p", "gold"): get("scores_untuned_dev_e0p_0_gold"),
    ("untuned, e3p", "predicted"): get("scores_untuned_dev_e3p_0_pred"),
    ("untuned, e3p", "gold"): get("scores_untuned_dev_e3p_0_gold"),
    ("fine-tuned", "predicted"): get("scores_tuned_dev_main_0_pred"),
    ("fine-tuned", "gold"): get("scores_tuned_dev_main_0_gold"),
}
dev = {k: list(h.jsonl("scores.jsonl")) for k, h in SCORES.items()}
dev_summary = {k: h.json("summary.json") for k, h in SCORES.items()}
program = {
    k: [{**s, "correct": s["program_correct"]} for s in v]
    for k, v in dev.items()
}
ci = {k: bootstrap_accuracy(v) for k, v in dev.items()}
ci_program = {k: bootstrap_accuracy(v) for k, v in program.items()}

n_turns = {len(v) for v in dev.values()}
dev_ids = {s["id"] for s in dev[("fine-tuned", "predicted")]}
n_conversations = len(dev_ids)
n_pages = len({page_group(i) for i in dev_ids})
# all six runs cover the same turns, every turn of the split
assert len(n_turns) == 1

pd.DataFrame(
    {
        "history": [h for _, h in dev],
        "execution accuracy": [
            f"{ci[k]['accuracy']:.1%}" for k in dev
        ],
        "95% interval": [
            f"[{ci[k]['low']:.1%}, {ci[k]['high']:.1%}]" for k in dev
        ],
        "program accuracy": [
            f"{ci_program[k]['accuracy']:.1%}" for k in dev
        ],
        "invalid outputs": [
            f"{dev_summary[k]['invalid_rate']:.1%}" for k in dev
        ],
    },
    index=pd.Index([s for s, _ in dev], name="system"),
)
history execution accuracy 95% interval program accuracy invalid outputs
system
untuned, e0p predicted 1.1% [0.3%, 2.2%] 1.0% 98.6%
untuned, e0p gold 25.1% [23.2%, 27.0%] 22.5% 68.1%
untuned, e3p predicted 56.8% [53.5%, 60.1%] 47.7% 17.6%
untuned, e3p gold 63.6% [61.1%, 66.1%] 55.4% 14.3%
fine-tuned predicted 81.3% [77.4%, 85.1%] 78.9% 0.1%
fine-tuned gold 90.3% [88.3%, 92.1%] 88.9% 0.0%

The split holds 421 conversations, written from 218 report pages, and 1490 turns. In each row the interval comes from resampling whole report pages 10,000 times (Chapter 13); it covers the choice of pages, and not the training seed, which is the matter of the rule above.

Code
#HEAVY
contrasts = {}
for history in ("predicted", "gold"):
    for other in ("untuned, e3p", "untuned, e0p"):
        contrasts[(other, history)] = paired_difference(
            dev[("fine-tuned", history)], dev[(other, history)]
        )

# the fine-tuned model is ahead of both untuned systems, in both
# histories, by more than the resampling noise: the seed rule does not fire
assert all(c["low"] > 0 for c in contrasts.values())
# and the gold history is ahead of the predicted one
gap_hist = paired_difference(
    dev[("fine-tuned", "gold")], dev[("fine-tuned", "predicted")]
)
assert gap_hist["low"] > 0

pd.DataFrame(
    {
        "difference": [
            f"{100 * c['difference']:+.1f}" for c in contrasts.values()
        ],
        "95% interval": [
            f"[{100 * c['low']:+.1f}, {100 * c['high']:+.1f}]"
            for c in contrasts.values()
        ],
    },
    index=pd.MultiIndex.from_tuples(
        [(f"fine-tuned minus {o}", h) for (o, h) in contrasts],
        names=["comparison", "history"],
    ),
).rename_axis(columns="points of execution accuracy")
points of execution accuracy difference 95% interval
comparison history
fine-tuned minus untuned, e3p predicted +24.5 [+21.0, +28.0]
fine-tuned minus untuned, e0p predicted +80.2 [+76.1, +84.1]
fine-tuned minus untuned, e3p gold +26.6 [+24.6, +28.7]
fine-tuned minus untuned, e0p gold +65.2 [+63.1, +67.2]

With the predicted history, the headline mode, the fine-tuned model answers 81.3% of the turns correctly. The untuned model with the best prompt answers 56.8%, and with the prompt the fine-tuned model is trained with 1.1%. The paired interval of the fine-tuned model against the first is [+21.0, +28.0] points, and against the second [+76.1, +84.1]. The other two intervals, with the gold history, are in the table. All four are far from zero, so the rule for more seeds did not fire, and the fine-tuned model of the book is the one seed. The gold history lifts the fine-tuned model to 90.3%, +8.9 points over its predicted-history score (paired interval [+6.6, +11.3]): what the model loses to its own earlier mistakes, as on validation.

Program accuracy is lower than execution accuracy for every system, since it asks for the gold program and not only for its answer (Chapter 13). The failures are of different kinds before and after fine-tuning:

Code
#HEAVY
from convfinqa.final_results import outcome_counts

outcomes = pd.DataFrame({
    f"{s}, {h}": outcome_counts(dev_summary[(s, h)])
    for (s, h) in dev
})
outcomes_pred = {s: outcome_counts(dev_summary[(s, "predicted")]) for s, _ in dev}
tuned = outcomes_pred["fine-tuned"]
wrong_tuned = sum(tuned.values()) - tuned["correct"]

# the untuned model loses most turns to the format of its answer; what is
# left after fine-tuning is mostly valid programs that are wrong
assert outcomes_pred["untuned, e0p"]["invalid output"] \
    > outcomes_pred["untuned, e0p"]["correct"]
assert tuned["invalid output"] <= 0.05 * wrong_tuned
assert tuned["wrong numbers"] == max(
    tuned[k] for k in (
        "wrong operations", "wrong numbers", "wrong answer, right shape"
    )
)
outcomes
untuned, e0p, predicted untuned, e0p, gold untuned, e3p, predicted untuned, e3p, gold fine-tuned, predicted fine-tuned, gold
correct 17 374 847 948 1212 1345
invalid output 1469 1015 262 213 1 0
wrong operations 0 56 201 171 82 48
wrong numbers 0 15 66 50 119 50
wrong answer, right shape 4 30 114 108 76 47

With the prompt it is trained on, the untuned model writes a program that runs in 21 of its 1490 turns, so most of its mistakes are the format of the answer. After fine-tuning, 1 of the 278 wrong turns are not a program, and the largest group is valid programs with other numbers (119). As on validation, what fine-tuning leaves behind is a reading and reasoning failure, not a writing failure. The book does not label these dev errors one by one: the error analysis of Section 13.6.2 was done on validation, so that no development failure was read before the freeze.

16.4 How much of the gap does a prompt close?

The untuned model with e0p and the fine-tuned model see the same input, so the distance between them is what fine-tuning adds. The untuned model with e3p has the best prompt that validation found. How much of that distance has the prompt already covered?

Code
#HEAVY
from convfinqa.final_results import share_of_gap_closed

closed = {
    h: share_of_gap_closed(
        dev[("untuned, e0p", h)], dev[("untuned, e3p", h)], dev[("fine-tuned", h)]
    )
    for h in ("predicted", "gold")
}
# the prompt closes a large part of the distance, but not all of it:
# the interval stays between 1/2 and 1 in both histories
assert all(0.5 < c["low"] and c["high"] < 1 for c in closed.values())

pd.DataFrame(
    {
        "gap, fine-tuned minus e0p": [
            f"{100 * c['gap']:.1f} points" for c in closed.values()
        ],
        "covered by the e3p prompt": [
            f"{c['share']:.0%}" for c in closed.values()
        ],
        "95% interval": [
            f"[{c['low']:.0%}, {c['high']:.0%}]" for c in closed.values()
        ],
    },
    index=pd.Index(list(closed), name="history"),
)
gap, fine-tuned minus e0p covered by the e3p prompt 95% interval
history
predicted 80.2 points 69% [66%, 73%]
gold 65.2 points 59% [56%, 62%]

With the predicted history the prompt covers 69% of the distance, and with the gold history 59%. Most of what fine-tuning adds can be had from a good prompt with three examples, and the rest, the part that the prompt cannot reach, is 24.5 points with the predicted history. Two things limit how far to read this. The prompt was developed on validation over several variants, while the fine-tuning configuration was fixed in advance, which favours the prompt. And the prompt is limited to describing the language: it does not teach the annotation conventions that the fine-tuning data show (Chapter 11), which a longer prompt could. The two routes also cost different amounts at inference: the examples make the prompt longer than the fine-tuned model’s (Chapter 13 measures it on validation).

16.5 Next to published results

The published numbers come from different set-ups, so this is a loose comparison. FinQANet (Chen et al. 2022) is given facts retrieved from the page, and its gold-facts variant and the few-shot GPT-3 of the same paper are given the facts that the annotators marked; ours reads the whole page. Our predicted history is the closest to how a published system would be used, and the gold history is an upper bound. Fin-R1 uses its own protocol (below). Nothing here is a leaderboard.

Code
#HEAVY
from convfinqa.final_results import PUBLISHED

ours = [
    (
        "this book, fine-tuned, predicted history",
        ("fine-tuned", "predicted"), "#b85450", "o"
    ),
    (
        "this book, fine-tuned, gold history (upper bound)",
        ("fine-tuned", "gold"), "#3b6ea5", "o"
    ),
    (
        "this book, untuned, e3p, predicted history",
        ("untuned, e3p", "predicted"), "#b85450", "s"
    ),
]
rows = [
    (f"{p['label']} ({p['split']})", p["accuracy"], None, None, "#6b6b6b", "D")
    for p in PUBLISHED
] + [
    (
        label, 100 * ci[k]["accuracy"], 100 * ci[k]["low"],
        100 * ci[k]["high"], colour, marker
    )
    for label, k, colour, marker in ours
]
rows.sort(key=lambda r: r[1])
ours_rank = {
    name: i for i, (name, *_) in enumerate(rows) if name.startswith("this book")
}
fine_tuned_rank = ours_rank["this book, fine-tuned, predicted history"]
published_above = sum(
    1 for name, value, *_ in rows
    if not name.startswith("this book") and value > rows[fine_tuned_rank][1]
)
published_below = sum(
    1 for name, value, *_ in rows
    if not name.startswith("this book") and value < rows[fine_tuned_rank][1]
)

# the fine-tuned model sits inside the published range, not at an end of it
assert published_above > 0 and published_below > 0

fig, ax = plt.subplots(figsize=(7.5, 4.6))
for i, (name, value, low, high, colour, marker) in enumerate(rows):
    if low is not None:
        ax.hlines(i, low, high, color=colour, linewidth=2, zorder=2)
    ax.plot(
        value, i, marker, color=colour, markersize=7, zorder=3,
        markerfacecolor=(
            "white" if name.startswith("this book, untuned")
            else colour
        ),
    )
    ax.text(
        value + (2.5 if low is None else (high - value) + 1.5), i, f"{value:.1f}",
        va="center", fontsize=8, color="#444444"
    )
ax.set_yticks(range(len(rows)), [r[0] for r in rows], fontsize=8)
for tick, (name, *_) in zip(ax.get_yticklabels(), rows):
    if name.startswith("this book"):
        tick.set_fontweight("bold")
ax.set_xlim(0, 100)
ax.set_xlabel("execution accuracy (%)")
ax.grid(axis="x", color="#dddddd", linewidth=0.6)
ax.set_axisbelow(True)
for side in ("top", "right", "left"):
    ax.spines[side].set_visible(False)
ax.tick_params(axis="y", length=0)
fig.tight_layout()
plt.show()
Dot chart of execution accuracy, one row per system, sorted from lowest to highest. Published results are grey diamonds, this book's systems are coloured with horizontal intervals. The fine-tuned model with predicted history sits between the published systems.
Figure 16.1: Execution accuracy on ConvFinQA, published results (grey diamonds, with what each paper says about its evaluation set) and three systems of this book on the development split (circles and a square, with the 95% interval). The set-ups differ: the published results are not run on the same input.

On development, with the predicted history, the fine-tuned model is ahead of 7 of the 9 published rows and behind 2; the gold-history point is an upper bound and is not comparable with them. The bold rows are ours. Two things keep the comparison loose: the inputs differ (above), and some rows do not say which split they use (FinQANet) or use a sample of 200 questions (the two human rows). Figure 16.1 is a map of where the number sits and not a ranking: a difference of a couple of points between rows is not a finding.

The ConvFinQA paper (Chen et al. 2022) gives the crowd, GPT-3, FinQANet and human rows (GPT-3 from its Table 5, the others from its Table 3), Li et al. (2023) the GPT-4 row, and Khatuya et al. (2025) the PoT-GPT-4, ENCORE and FINDER rows. Fin-R1 (Liu et al. 2025) also reports a ConvFinQA figure, but its answers are judged by a language model on a random sample whose split it does not state, so it measures something else and is left out.

16.6 Were the validation numbers optimistic?

The choices of the book were made on validation: the prompt, the checkpoint, the grammar, the format. If a choice had fitted the validation conversations in a way that does not carry over, the development numbers would be lower. The check is the same three systems, both histories, on the two splits. The splits hold different pages, so each accuracy is resampled on its own, and the interval is for the difference of the two.

Code
#HEAVY
from convfinqa.final_results import split_difference

VAL_SCORES = {
    ("untuned, e0p", "predicted"): get("scores_untuned_val_e0p_0_pred"),
    ("untuned, e0p", "gold"): get("scores_untuned_val_e0p_0_gold"),
    ("untuned, e3p", "predicted"): get("scores_untuned_val_e3p_0_pred"),
    ("untuned, e3p", "gold"): get("scores_untuned_val_e3p_0_gold"),
    ("fine-tuned", "predicted"): get("scores_tuned_val_main_0_pred"),
    ("fine-tuned", "gold"): get("scores_tuned_val_main_0_gold"),
}
val = {k: list(h.jsonl("scores.jsonl")) for k, h in VAL_SCORES.items()}
ci_val = {k: bootstrap_accuracy(v) for k, v in val.items()}
moved = {k: split_difference(dev[k], val[k]) for k in dev}
significant = [k for k, m in moved.items() if m["excludes_zero"]]
# the sentence below names the exception: the untuned model with the training prompt, which does not move with the training
assert significant

# nothing that validation chose is significantly worse on dev: the two
# systems that went through the book's choices (the fine-tuned model and the
# prompt picked on validation) stay within the noise
assert not any(s in ("fine-tuned", "untuned, e3p") for s, _ in significant)
# and the fine-tuned model scores lower on dev than on val in both histories,
# as selection on val would make it, though not by more than the noise
assert all(
    moved[("fine-tuned", h)]["difference"] < 0 for h in ("predicted", "gold")
)

pd.DataFrame(
    {
        "validation": [f"{ci_val[k]['accuracy']:.1%}" for k in dev],
        "development": [f"{ci[k]['accuracy']:.1%}" for k in dev],
        "difference": [f"{100 * moved[k]['difference']:+.1f}" for k in dev],
        "95% interval": [
            f"[{100 * moved[k]['low']:+.1f}, {100 * moved[k]['high']:+.1f}]"
            for k in dev
        ],
    },
    index=pd.MultiIndex.from_tuples(list(dev), names=["system", "history"]),
).rename_axis(columns="execution accuracy, points for the last two")
execution accuracy, points for the last two validation development difference 95% interval
system history
untuned, e0p predicted 0.3% 1.1% +0.9 [-0.1, +2.0]
gold 28.1% 25.1% -3.0 [-5.9, -0.2]
untuned, e3p predicted 57.2% 56.8% -0.3 [-5.5, +4.9]
gold 66.0% 63.6% -2.4 [-6.2, +1.4]
fine-tuned predicted 83.7% 81.3% -2.4 [-7.8, +3.2]
gold 90.6% 90.3% -0.3 [-3.2, +2.7]

The fine-tuned model is 2.4 points lower on development than on validation with the predicted history and 0.3 with the gold history, and the untuned model with e3p differs by -0.3 and -2.4. None of these four intervals excludes zero, so the data cannot tell a small optimism of selection from the difference between two samples of pages; they show that the validation numbers were not far off. 1 of the six differences has an interval that does exclude zero: untuned, e0p with the gold history. That is the untuned model with the prompt of the fine-tuned model, which no choice of the book depended on, and it is the floor of the comparison, so a few points of difference does not change what the chapter concludes.

16.7 What this chapter does not report

Only the comparison above is run on the development split. The other comparisons of the book are results on validation, reported where they are made, and the book does not claim them for the development split: the untuned prompt variants, the e3p prompt on the fine-tuned model and the extra-compute rows (Chapter 13); the DSL against Python, untuned and fine-tuned (Chapter 14); the grammar rows (Chapter 15); the merged adapter; and the rank sweep (Chapter 17). The reason is the same for all: a result on the development split is a result that is reported, once, and the more comparisons are run on it, the more of its value as a check is spent.

The result is also limited in three ways. It is one training seed, so the interval of a number is for the choice of pages and does not include the noise of training; the rule for more seeds did not call for them, but a second seed is what would measure it. The prompt of the untuned model had one example set. And the numbers are on one benchmark, with one model, so the contrast with published work is of a set-up and not of a method.