Abstract
Algorithm learning remains challenging in computer science education due to its abstract logic, steep conceptual difficulty, and lack of personalized support in traditional settings. This study presents AlgoLLM, a modular instructional system built on large language models (LLMs) to support students through natural language explanations, code-level guidance, and feedback-based refinement. The system includes four core components: Knowledge Explainer, Exercise Generator, Code Assistant and Debugger, and Feedback Evaluator. A four-week case study was conducted with 60 undergraduate students, comparing a control group using textbooks and an experimental group using AlgoLLM. Paired and independent t-tests showed that the experimental group achieved significantly higher learning gains in post-tests (mean increase of 18.3 percent, Cohen's d = 0.94). Code accuracy and task efficiency also improved. Pearson correlation revealed a moderate relationship between LLM interaction frequency and learning gain. Questionnaire feedback indicated high perceived usefulness, clarity, and satisfaction. These results suggest that LLM-based systems like AlgoLLM can enhance algorithm comprehension and offer scalable, personalized support in technical education.
Introduction
Algorithm learning is notoriously difficult. Concepts like recursion, complexity analysis, and graph traversal require high levels of abstract thinking and logical tracing. In traditional higher education settings, students often hit "bottlenecks" where they get stuck on a specific logic flow. While a human tutor could provide immediate, personalized feedback, professors in large classrooms cannot scale this support. Traditional materials such as textbooks and static problem sets are often "one-size-fits-all" and offer no real-time interaction.
While Large Language Models (LLMs) like GPT-4 seem like a natural fit for this gap, they often suffer from "hallucinations"—generating plausible-sounding but technically incorrect code or logic—which can reinforce student misconceptions. To address this, we developed AlgoLLM, a modular instructional framework designed to provide reliable, personalized "scaffolding" for technical education.
System Design and Methodology
AlgoLLM is implemented in Python using the GPT-4 model. To solve the reliability problem, the system integrates a Retrieval-Augmented Generation (RAG) pipeline. This uses a JSON-structured algorithm knowledge base indexed by a vector database to ensure the AI’s explanations align with verified technical content.
As shown in the architecture diagram, the system consists of four core modules:
- Knowledge Explainer: Breaks down concepts using natural language and analogies.
- Exercise Generator: Creates practice problems that adapt in difficulty based on student performance.
- Code Assistant & Debugger: Analyzes student-submitted Python code for logic and syntax errors.
- Feedback Evaluator: Scores submissions and provides concise yet actionable diagnostics.
The frontend was built with Streamlit, providing a conversational interface with a persistent sidebar for history and module switching.
Experimental Evaluation
The study involved 60 undergraduate computer science students at Shantou University, China. The cohort was split into a control group using traditional textbooks and an experimental group using AlgoLLM over a four-week period. Evaluation metrics included pre-test and post-test scores, code accuracy ratios, and interaction logs.
Key Results
The experimental group demonstrated significant improvements across all metrics. The average score for students using AlgoLLM jumped from 58.9 to 75.6, while the control group only moved from 58.7 to 64.3.
- Learning Gains: The experimental group achieved a mean increase of 18.3% in post-test scores (Cohen's d = 0.94).
- Code Accuracy: Students using AlgoLLM maintained a code accuracy range of 0.85–0.95, significantly higher than the control group’s 0.65–0.78.
- User Satisfaction: The system received an average satisfaction rating of 4.63 out of 5, with students specifically praising the "step-by-step" nature of the explanations.
Discussion and Insights
The researchers found a modest positive correlation between how often a student interacted with the LLM and their final score gain. This suggests that the value isn't just in the "answer" the AI provides, but in the iterative, back-and-forth process of clarification. Qualitative interviews revealed that the AI acted as a "confidence-building companion." Students felt less intimidated by abstract topics like recursion because they could ask questions without judgment and get immediate breakdowns.
Furthermore, the Code Assistant module was particularly effective at helping students move past "off-by-one" errors and loop logic issues, which often act as frustrating barriers to understanding the higher-level algorithm. The authors emphasize that for technical education, a "naked" LLM isn't enough; the integration of symbolic knowledge (RAG) is what makes the system trustworthy.
Limitations and Future Work
Despite the success, several hurdles remain. There is a risk of over-reliance, where students might accept AI outputs uncritically. The system also struggles with very high-context queries or extremely complex reasoning chains. Future versions aim to include multimodality (e.g., sketch recognition for tree structures) and long-term modeling to track a student's knowledge state over longer periods.
Conclusion
AlgoLLM demonstrates that modular, RAG-enhanced LLM systems can provide effective, scalable, and personalized support for complex technical subjects like algorithm learning. By bridging the gap between abstract theory and practical implementation, such tools can significantly enhance student outcomes in higher education.
Summary updated