SEFL (\textbf{S}ynthetic \textbf{E}ducational \textbf{F}eedback \textbf{L}oops) is a framework designed to generate on-demand, concise, and targeted feedback for educational settings. Instead of relying on real-world student data—which often raises privacy and consent issues—SEFL simulates a teacher–student feedback loop using Large Language Models (LLMs). In particular:
-
Synthetic Data Generation
Two LLM "agents" (a Teacher-Agent and a Student-Agent) produce assignment and answer pairs. The Student-Agent introduces deliberate errors, and the Teacher-Agent provides specific, formative feedback on each error.
-
Fine-tuning on Synthetic Data
Smaller or mid-sized models (like Qwen2.5-14B-Instruct) are then fine-tuned on the teacher–student interaction data. This allows them to provide high-quality, contextually relevant, and concise feedback on new educational tasks.
-
Efficiency and Scalability
Because the data is fully synthetic, fine-tuning can be done at scale without the usual bottlenecks of data acquisition and anonymization.
1from transformers import AutoTokenizer, AutoModelForCausalLM
2
3model_name = "jjzha/Llama-3.1-8B-Instruct-SEFL"
4tokenizer = AutoTokenizer.from_pretrained(model_name)
5model = AutoModelForCausalLM.from_pretrained(model_name)
6
7prompt = """<Insert assignment and student answer here>"""
8
9inputs = tokenizer(prompt, return_tensors="pt")
10
11outputs = model.generate(**inputs, max_length=512)
12
13response = tokenizer.decode(outputs[0], skip_special_tokens=True)
14
15print(response)