Confidence Scores
LlamaIndex

Financial summary values connected to extracted fields, with confidence scores indicating which values to accept or review.

In summer 2026, I worked on confidence scores for LlamaIndex’s Extract product as a Member of Technical Staff Intern.

Extract takes unstructured data, like PDFs, and extracts information out of it according to a schema specified by the user. Each extracted value has a confidence score representing how confident the user should be that the extracted value is right. I worked on making those scores more useful.

When I joined, confidence scoring was still in beta. The system used the extractor agent's token log probs as the confidence score. This is the probability that the agent outputted the field it did, and you'd intuitively expect this to be a decent proxy for confidence.

The problem here, is that LLMs tend to be very overconfident. Every token has a very high probability of being outputted, and thus most scores were clustered > 0.999, making it difficult for customers to resolve errors. Furthermore, null values had no outputted tokens, and thus had no confidence scores.

Looking at this, I saw there were three core problems to solve.

  1. Ranking: How do we make a correct field have higher confidence than an incorrect field?
  2. Calibration: How do we calibrate confidence scores to customer expectations? What distribution of confidence scores is ideal, and how do we achieve it?
  3. Serving: Given a confidence model, how do we serve it in production for millions of jobs?

Over 4 months, we solved all 3 problems, and deployed a new, much stronger confidence model to production. I owned majority of the design and implementation, with guidance and steering from my immensely talented mentors.

The new confidence scores were evaluated on ExtractBench, a diverse benchmark for document extraction, as shown below. This graph below shows strong ranking of incorrect vs. correct extractions, with a low AUGRC for LlamaExtract.

Cost versus unflagged error risk: Agentic Plus scores 15.0 AUGRC times 1,000 at 8.53 US cents per page; Agentic 16.4 at 3.43 cents; Reducto 24.8 at 5.25 cents; Extend 28.0 at 12.11 cents.
Horizontal axis: billed cost in US cents per page. Vertical axis: AUGRC × 1,000, a measure of unflagged error risk across acceptance levels. Lower is better on both axes. Benchmark details · View full size ↗

The graph below shows the distribution and coverage of our confidence scores. Notice the distribution of scores skews left, with many scores clustering > 0.95, as intuitively expected of a strong extraction system. However, the distribution is also slightly bimodal with a batch of scores near 0, intuitively representing likely errors and strong calibration. Notice also the 770k unique confidence values, allowing for granular control over acceptance threshold. Finally, notice the 100% coverage, making the score reliable and solving the issue of null scores mentioned above.

Confidence score distributions: Agentic Plus has 100% score coverage and 770,431 distinct scores, Reducto has 36.08% coverage and 989 distinct scores, and Extend has greater than 99.99% coverage and five distinct scores.
Score coverage and distributions on ExtractBench. Coverage measures returned values with scores; it is separate from extraction recall. Source and methodology · View full size ↗

For a deeper look at these results, check this out.

Reflecting back on my experience at LlamaIndex, I'm grateful for the level of scope and freedom I was given. I'm glad I wasn't given a toy problem, and was given an important customer feature. Customers asking for my very project during the internship really kept me motivated to keep working and deliver a great solution, and I'm happy to say we did.

I'm most grateful, though, for the incredible culture and mentorship at LlamaIndex. I learned so much about how real engineering works at a fast-paced startup with a very flat organizational structure, and about the types of problems that come up when shipping production-level ML systems.

Very fun summer! I enjoyed the bay area as well, especially hiking Mt. Tam and scootering around the city.

Three people hiking up a grassy hillside above the clouds at dusk, under a pink and blue sky.