Goal
The bookkeeping study app “debicre” estimates how well a learner understands each topic, and uses it to pick the next questions and to forecast exam scores.
The goal is to predict this understanding with a model learned from real answers. If it predicts well, weak spots come up first and the score forecast gets more accurate.
What I did
- Chose a model that stays stable with little data
- Decided how to evaluate it: by predicting whether the next answer is correct
- Designed an A/B test with a metric that shows differences even with few people
This post covers the design. Implementation and results come in the next post.
The hard part: little data
debicre is still a small app, so there are few answers. It is nowhere near what the deep learning models in papers need. Every decision below comes from this constraint.
The overall flow
- Log: record time per answer, and what “Today” offered
- Export: replace user IDs with pseudonyms; no names or emails
- Train: on my own Mac
- Ship: send the learned numbers to the app and the web as JSON
- Infer: compute understanding on the device
1. Share features instead of learning per topic
There were three candidates.
- Per-topic knowledge tracing: few answers per topic, so the values are unstable
- Logistic (PFA / DAS3H family): stable even with little data. Chosen
- Deep learning (DKT / SAKT): cannot be trained on this much data
Learning numbers per topic makes topics with only a dozen answers swing wildly. So the model learns from features shared across topics.
P(correct) = σ( learner ability
− question difficulty
+ per-topic effect of
past right / wrong )
Difficulty comes from the difficulty level, the answer type (choice or typed), the exam grade and the importance. These features are shared by all topics, so a topic with few answers is supported by data from the others. The forgetting effect enters as answer counts over the last 1, 7 and 30 days.
2. Deep learning on public data
I did not drop deep learning; I use it in a different place.
- Implement and evaluate DKT / SAKT on public datasets such as ASSISTments
- On debicre’s data, compare against the logistic model to see which predicts better while data is small
- Compare again once there is enough data
Picking what predicts well at today’s data size came before adding a fashionable model.
3. Human intuition as the baseline
Today, understanding is computed with numbers set from experience (weights for right and wrong answers, how fast things are forgotten). They stay, as something to beat.
- Predictions with the hand-set numbers
- The same formula with only its numbers refitted to data
- The new model
If the new model does not beat the baseline, it does not replace it.
4. Evaluate on “the next question”
What I really want is an accurate score forecast. But there are still few first attempts at mock exams, too few to judge a model by.
So the main evaluation is predicting whether the next answer is correct. Every answer becomes a test case.
- Split each learner’s answers by time: train on the first 80%, predict the last 20% (no future information)
- Retries are not prediction targets, but are used as input
- Check ranking (AUC) and honest probabilities (calibration), by answer type and by grade
Score-forecast error is reported as a reference, with a range.
5. A/B test on a metric that works with few people
A better model only matters if it makes better practice. “Today” is split into a group that picks questions with the new model and a group that keeps the current rule.
- Main metric: accuracy when the same topic is answered again 7 or more days later. The same people answer many times, so differences show even with few people
- Not used: retention rate. With few people, it takes far too long to show a difference
- Readout: a Bayesian “probability the new picks are better”, running at least 4 weeks
- Assignment:
hash(experiment + userID) mod 100. No server state, and the same group on web and app
At first only the order changes, not the kinds of questions offered.
6. Compute on the device
Training happens on my machine; devices only receive the learned numbers. Understanding is computed on the device as it is today, so server load does not grow.
What’s next
First comes logging answer time and what was offered. When there are results, I will write the next post.
Rather than wait for more data, I will measure how well the data I have can predict.