Uppsats

Theme-Based Rewriting of Programming Exercises : A Lightweight LLM and Retrieval-Augmented Generation Pipeline

Master-uppsats

KTH/Skolan för elektroteknik och datavetenskap (EECS)

Publicerad: 2026

Språk: Engelska

Sammanfattning

In the field of education, enhancing student engagement remains a challenge. Research indicates that personalisation offers one solution, though this can require significant manual effort. Large language models (LLMs) provide a viable way to reduce this workload. At the same time, employing lightweight models is crucial for local deployability. Rewriting structured problems, e.g., coding problems, into a specified theme while preserving solvability remains an open problem, and this challenge is amplified when using lightweight models, which struggle to maintain the original constraints. We propose a pipeline that combines an 8B LLM with Retrieval-Augmented Generation (RAG). By leveraging contextual retrieval together with a retry mechanism, the pipeline reliably produces rewritten problems with valid formatting. Using prompt engineering and placeholders to protect LaTeX and code snippets, the structural constraints of the original tasks are preserved. Experiments demonstrate that, even with an 8B model, the rewritten problems retain high solvability while successfully shifting to the target theme. The resulting pipeline supports personalised themed problems for learners, reduces manual adaptation effort for educators, and provides researchers with a reproducible framework for studying structured rewriting using lightweight LLMs.

Information

Författare
Li, Leran
Lärosäte / institution
KTH/Skolan för elektroteknik och datavetenskap (EECS)
Publiceringsdatum
2026
Uppsatstyp
Master-uppsats
Språk
Engelska

Utforska vidare

Liknande uppsatser

Uppsatser med liknande ämnen och nyckelord.