🧠 MCQGenerator – Fine-tuned LLaMA 3.1 8B for Educational Assessment

This model is a fine-tuned version of Meta’s LLaMA 3.1 8B, trained specifically for generating Multiple Choice Questions (MCQs) from academic passages using Alpaca-style instructions.

It was developed as part of a personalized learning platform focused on adaptive assessments for K–12 education. The model generates exactly n questions at a given difficulty level and returns the correct answers, making it suitable for real-time evaluations in edtech platforms.


🎯 Purpose

  • πŸ” Generate clear and structured MCQs from textual content
  • πŸ§ͺ Create assessments tailored to specific difficulty levels
  • πŸ‘©β€πŸ« Help educators and edtech apps automate quiz creation
  • πŸ§‘β€πŸŽ“ Reinforce learning through adaptive testing and feedback

🧠 Model Details

  • Base Model: LLaMA 3.1 8B
  • Training: Instruction-tuned using custom educational data
  • Prompt Style: Alpaca (instruction β†’ input β†’ response)
  • Dataset: 10,000+ curated educational passages with human-authored MCQs
  • Frameworks: Hugging Face Transformers, PEFT (LoRA), Accelerate

✍️ Alpaca-Style Prompt Format

The model expects prompts in the following format:

You are an intelligent and precise Multiple Choice Questions (MCQs) Generator, designed to create effective assessments.
Your goal is to generate exactly {no_mcq} clear, well-structured MCQs with four answer options each.
Ensure each MCQ has options labeled A, B, C, and D.
Also, give the answer key for all the questions at the end.

Do not generate more or fewer than {no_mcq} questions.
Do not include explanations or extra commentary.

### Instruction:
Generate exactly {no_mcq} {level}-level MCQs based on the following passage:

### Input:
{passage}

### Response:

Output:

  1. At what temperature does water boil under standard atmospheric pressure?
    A) 90Β°C
    B) 95Β°C
    C) 100Β°C
    D) 110Β°C

  2. What is the boiling point of water under standard conditions?
    A) 0Β°C
    B) 50Β°C
    C) 100Β°C
    D) 150Β°C

  3. Under what condition does water boil at 100Β°C?
    A) High pressure
    B) Low pressure
    C) Vacuum
    D) Standard atmospheric pressure

Answer Key:

  1. C
  2. C
  3. D

Usage:

from transformers import pipeline

generator = pipeline("text2text-generation", model="goenkalokesh/MCQGenerator")

prompt = """ You are an intelligent and precise Multiple Choice Questions (MCQs) Generator, designed to create effective assessments. Your goal is to generate exactly 3 clear, well-structured MCQs with four answer options each. Ensure each MCQ has options labeled A, B, C, and D. Also, give the answer key for all the questions at the end.

Do not generate more or fewer than 3 questions. Do not include explanations or extra commentary.

Instruction:

Generate exactly 3 Medium-level MCQs based on the following passage:

Input:

India gained independence from British rule in 1947 after years of struggle and sacrifice by freedom fighters.

Response:

"""

output = generator(prompt, max_new_tokens=400) print(output[0]['generated_text'])

πŸ§‘β€πŸ’» Author

Lokesh Goenka πŸŽ“ M.Sc. in Data Science & Computing πŸ”¬ Working on AI for Education, Adaptive Testing & Personalized Learning 🌐 Hugging Face Profile

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Space using goenkalokesh/MCQGenerator 1