Model Card for Llama-3.2-1B ML-QRECC Rewriter

This model is a fine-tuned version of meta-llama/Llama-3.2-1B-Instruct that has been optimized for question rewriting tasks using the ML‑QRECC dataset. The goal is to transform original user queries into more refined or reformulated versions, enhancing search query performance in various applications.

Model Details

Model Description

This is the model card for a 🤗 transformers model that has been pushed to the Hub. It represents a version of the LLaMA-3.2-1B model fine-tuned via LoRA on the ML‑QRECC dataset to perform question rewriting. Key details include:

  • Developed by: Aygün Varol
  • Funded by: Ministry of National Education of the Republic of Türkiye and by the Jane and Aatos Erkko Foundation EVIL-AI project
  • Shared by: Aygün Varol
  • Model type: Causal Language Model / Instruction-Tuned LM
  • Language(s) (NLP): English
  • License: MIT
  • Finetuned from model : meta-llama/Llama-3.2-1B-Instruct

Model Sources

  • Repository: -
  • Paper : -
  • Demo : -

Uses

Direct Use

This model can be used to rewrite or reformulate user queries. By generating clearer and potentially more effective versions of input questions, it can improve the performance of search and retrieval systems in multimedia or web applications.

Downstream Use

The fine-tuned model can be integrated into larger systems, for example:

- In search engines to enhance query understanding.

- In conversational agents where query clarity is critical.

- In research settings to study the impact of question rewriting on retrieval accuracy.

Out-of-Scope Use

  • The model is not designed for general-purpose text generation beyond query rewriting.

  • It may not perform well on non-English queries.

  • It is not intended for applications where high factual precision is required.

Bias, Risks, and Limitations

Bias:

  • The model may reflect biases present in the ML‑QRECC dataset. Users should be cautious of potential overgeneralizations or systematic biases in the rewritten queries.

Risks:

  • The generated rewritten queries may include irrelevant or overly verbose reformulations. It is recommended to validate outputs, especially for critical applications.

Limitations:

  • Performance might degrade on queries that differ significantly from those seen during fine-tuning.
  • It might produce multiple variants when a single, concise output is preferred.

Recommendations

Users should consider implementing post-processing or validation steps to ensure the rewritten queries meet their specific requirements before deployment.

How to Get Started with the Model

Use the code below to get started with the model.

from transformers import AutoModelForCausalLM, AutoTokenizer

model = AutoModelForCausalLM.from_pretrained("Aygun/llama-3.2-1B-MLQRECC-Rewriter")
tokenizer = AutoTokenizer.from_pretrained("Aygun/llama-3.2-1B-MLQRECC-Rewriter")

prompt = "Rewrite the question: What is a physician's assistant?\n\nRewritten question:"
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=50)
rewritten_question = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(rewritten_question)

Training Details

Training Data

The model was fine-tuned on the ML‑QRECC dataset. This dataset contains pairs of original questions and their corresponding rewritten versions, which provide a realistic basis for training models to optimize query clarity and relevance.

Training Procedure

Data was preprocessed to create prompt–completion pairs in the following format:

Prompt:

"Rewrite the question: <original question>\n\nRewritten question:"

Completion:

  • The corresponding rewritten version from the ML‑QRECC dataset.

The model was fine-tuned using the LoRA (Low-Rank Adaptation) technique to efficiently adapt the base LLaMA-3.2-1B-Instruct model to the rewriting task.

Training Hyperparameters

  • Base Model: meta-llama/Llama-3.2-1B-Instruct
  • LoRA Rank: 16
  • LoRA Alpha: 32
  • Target Modules: ["q_proj", "k_proj", "v_proj", "o_proj"]
  • LoRA Dropout: 0.05
  • Number of Epochs: 3
  • Per Device Batch Size: 2
  • Gradient Accumulation Steps: 4
  • Learning Rate: 2e-4
  • Warmup Steps: 100
  • Mixed Precision: Enabled (fp16)

Citation [optional]

BibTeX:

@misc{llama_mlqrecc_rewriter,
  title={Llama-3.2-1B ML-QRECC Rewriter},
  author={Aygün Varol},
  note={Fine-tuned version of meta-llama/Llama-3.2-1B-Instruct using LoRA on the ML-QRECC dataset for question rewriting.},
  year={2025}}

APA:

Aygün Varol (2025). Llama-3.2-1B ML-QRECC Rewriter (Fine-tuned version of meta-llama/Llama-3.2-1B-Instruct using LoRA on the ML‑QRECC dataset for question rewriting). Retrieved from Hugging Face Hub.

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