← Latest papers
💻 computer science

Automated Recommendation of Programming Learning Content Using Pattern-based Knowledge Components

This paper presents and evaluates a method for automatically recommending programming learning resources by extracting pattern-based Knowledge Components from code samples to identify conceptually similar activities, demonstrating superior performance over existing baselines in aligning with expert-organized instructional bundles.

Original authors: Muntasir Hoq, Griffin Pitts, Zhangqi Duan, Arun Balajiee Lekshmi Narayanan, Mohammad Hassany, Andrew Lan, Peter Brusilovsky, Bita Akram

Published 2026-07-08
📖 5 min read🧠 Deep dive

Original authors: Muntasir Hoq, Griffin Pitts, Zhangqi Duan, Arun Balajiee Lekshmi Narayanan, Mohammad Hassany, Andrew Lan, Peter Brusilovsky, Bita Akram

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you are trying to learn how to cook. You have a massive library of recipes, but they are all jumbled together. You want to find a recipe that is similar to the one you are currently struggling with, but not just because it uses the same ingredients (like "salt" or "flour"). You want one that uses the same technique (like "sautéing" or "folding in egg whites").

This paper is about building a smart system that acts like a master chef to automatically find those perfectly matched cooking lessons for students learning to code.

The Problem: Too Many Recipes, Too Much Manual Work

In programming classes, students learn best by looking at a solved example (a "worked example") and then trying to solve a similar problem themselves. Teachers usually hand-pick these pairs. They look at a student's problem and say, "Ah, this is about loops, so let's show them this specific example about loops."

But as the library of coding problems grows, it becomes impossible for teachers to manually link every single problem to its perfect match. It's like trying to organize a library of a million books by hand. Early computer attempts to do this were too shallow; they just looked for words that appeared in the code (like finding the word "loop" in both). But two pieces of code can have the word "loop" in them but be solving completely different problems, or they can solve the same problem using totally different words.

The Solution: Finding the "Secret Patterns"

The authors created a system that doesn't just read the words in the code; it looks at the structure of the code, like a detective looking at the blueprint of a building rather than just the paint color.

They call these structural blueprints "Knowledge Components" (KCs). Think of a KC as a specific, reusable "move" in a dance routine.

  • Old way: "This dance has a spin." (Too vague).
  • New way: "This dance has a 'spin followed immediately by a jump' pattern." (Specific and meaningful).

The system breaks down every piece of student code into these "moves" (patterns). It then groups codes together based on whether they share the same complex moves, regardless of what variable names or specific numbers were used.

How It Works (The Recipe)

  1. Deconstructing the Code: The system takes a piece of code and turns it into a tree-like diagram (an Abstract Syntax Tree).
  2. Finding the Moves: It scans this tree to find the most important "sub-routines" or patterns. It ignores the fluff (like variable names) and focuses on the logic (like "checking if a number is even").
  3. Creating a Profile: Each piece of code gets a "profile card" (a vector) that lists which patterns it contains.
  4. Matching: When a student is stuck on a problem, the system looks at their profile card and finds other cards that have the most matching patterns. It's like saying, "You are trying to do a 'spin-jump,' so here is a tutorial on how to do a 'spin-jump'."

The Results: Did It Work?

The team tested this on a collection of Python programming exercises that had already been organized by expert teachers into "bundles" (groups of related problems).

  • The Test: They asked the computer: "Here is a problem. Can you find the matching example?"
  • The Winner: Their new "Pattern-Based" system was the best at finding the right matches. It beat other methods that just looked at code structure or used big AI models to guess the concepts.
  • The Score: It correctly identified the expert-chosen match in the top 5 suggestions 89% to 90% of the time.

The "Why" (Explainability)

One of the coolest features is that the system doesn't just give an answer; it explains why.
Imagine the system highlights the specific lines of code that made the two problems match.

  • For the Student: It says, "I recommended this because you both use a specific 'if-else' logic to check if a number is positive or negative." It helps them see the underlying logic, not just the surface details.
  • For the Teacher: It acts like an audit trail. A teacher can look at the recommendation and see exactly which "move" the computer used to make the connection, ensuring the system isn't making weird mistakes.

The Bottom Line

This paper presents a tool that helps organize and recommend programming lessons automatically. Instead of relying on teachers to manually link thousands of problems, or computers that just match keywords, this system understands the structural patterns of code. It successfully groups similar learning activities together, outperforms other automated methods, and can explain its choices by pointing to the specific logic in the code. This makes it easier to scale up programming education, giving students the right practice at the right time without needing a human to curate every single link.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →