Contextualizing Beginner Programming Exercises with Small Language Models

Contextualized programming exercises can make abstract introductory programming tasks feel more meaningful, but manually adapting exercises for many learner interests does not scale. Large language models can generate or rewrite exercises, yet their use can introduce privacy, cost, and infrastructure concerns when student data or preference profiles are sent to external services. This paper investigates whether small language models that can be run locally are capable of contextualizing beginner programming exercises while preserving the original learning objective. We evaluated 1,260 contextualized exercises created by 13 small language model variants and one commercial large language model baseline. The design crossed five beginner programming exercises, three learner-interest contexts, three prompting strategies, and two runs per condition. Outputs were manually rated using four rubric dimensions: context presence, context relevance, goal preservation, and clarity. The results show that several small models, especially mid-sized general-purpose Qwen3 models, received context-presence and context-relevance ratings similar to those of the commercial baseline in this evaluation. However, output quality varied substantially across model families and exercises, and ratings for paired generations showed some run-to-run variation. The evaluated code-specialized models generally received less favorable ratings than the general-purpose models, and ratings did not improve consistently with model size.

Link
https://www.semanticscholar.org/paper/991db8227f2f8f8123cf172a9e31e79d49272b26
Found by
Semantic Scholar
Authors
Daniel Kaluski, Lukas Ahrenberg, Juho Leinonen
Categories
evaluation
Published
2026-11-05
Last seen by the radar
2026-11-06
Citations
0
Influential citations
0
Radar score
31.51 / 100 (how it is scored)
Why it scored so
Matched: evaluat; Primary record: Semantic Scholar
Related links
https://doi.org/10.1145/3856208.3856248
Is this record right? If you made this work and something here is wrong or missing, tell us what to fix.

More records found by Semantic Scholar