Work · 2026
LLM highlight detection with sentence citations
Finding shareable moments in lesson transcripts, with the model citing sentence numbers instead of inventing timestamps.
The problem
Parents like seeing a short clip of their child doing well in a lesson. Finding those moments by hand does not scale, and a model asked to pick highlights from a transcript will happily return timestamps that look plausible and are wrong. A clip that starts mid-sentence, or lands on the wrong part of the lesson, is worse than no clip.
What I built
The first step was a place to put the results. I built a polymorphic analysis store keyed by an analysis-type enum. Each new kind of analysis is a new enum case with its own schema, so the storage, queueing and versioning are shared rather than rebuilt for every feature.
Highlight detection is the first consumer. The key design decision is what the model is allowed to say. Instead of asking for start and end times, I number the sentences in the transcript and ask the model to cite sentence numbers. Those numbers are then mapped back to real timings from the transcript data. The model can still choose a poor highlight, but it can no longer invent a time range, because the only things it can point at are sentences that exist.
Two guards sit around the model call:
- Weak transcripts are gated out before any model spend. If a transcript is too thin or too noisy to yield a good clip, we do not pay to find out.
- The whole feature is behind a flag, so it could be switched on gradually and switched off without a deploy.
Why it works this way
I treat the model as a component whose output has to be checked, not a source of truth. Constraining what it can return, validating citations against the source and skipping inputs we know are bad were all cheaper than trying to detect hallucinated timings afterwards.
The analysis store is the part I expect to last. Summaries, next-lesson plans and cumulative reviews are being built on it as further analysis types.
What I’d do next
Measure the quality of the picks properly, with a small human-labelled set of transcripts and a score for how well the model’s highlights match. I would also like to cache sentence-numbered transcripts so that re-running an analysis with a new prompt version does not rebuild its input each time.