Downloads · 30 days
17
20% of all-time downloads
kawchar85/Llama2-TIFA-AWQ
Llama2-TIFA-AWQ is a text generation model from kawchar85. Use it when you need the model to write or continue text. The card lists the license as apache-2.0.
Llama2-TIFA-AWQ is a fine-tuned and AWQ-quantized version of tifa-benchmark/llama2tifaquestiongeneration that addresses structural limitations in the original TIFA question generation model while providing significant…
Downloads · 30 days
17
20% of all-time downloads
All-time downloads
85
Public
Parameters
6.7B
3.9 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors3.9 GB · 100%
How the weights are stored.
I326.5B · 96%
From the Hugging Face model README
Llama2-TIFA-AWQ is a fine-tuned and AWQ-quantized version of tifa-benchmark/llama2_tifa_question_generation that addresses structural limitations in the original TIFA question generation model while providing significantly faster inference. The model combines structural refinement with AWQ quantization to achieve optimal performance-speed balance for TIFA question generation.
This model represents a refinement approach rather than training from scratch:
This model includes AWQ (Activation-aware Weight Quantization) for optimal inference speed:
This model generates exactly 4 structured visual verification questions for text-to-image evaluation:
Training Method: Supervised Fine-Tuning with LoRA on pre-trained TIFA model
LoRA Configuration:
["q_proj", "k_proj", "v_proj", "o_proj", "gate_proj", "up_proj", "down_proj"]Training Parameters:
pip install transformers torch autoawq
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
import torch
model_path = "kawchar85/Llama2-TIFA-AWQ"
# Load AWQ quantized model and tokenizer
tokenizer = AutoTokenizer.from_pretrained(model_path)
model = AutoModelForCausalLM.from_pretrained(
model_path,
torch_dtype=torch.float16,
device_map="auto"
)
# Create pipeline (optimized for ~8 second inference)
pipe = pipeline(
"text-generation",
model=model,
tokenizer=tokenizer,
max_new_tokens=512,
do_sample=True,
temperature=0.7,
top_p=0.9,
)
# System prompt for TIFA question generation
system_msg = """\
You are a TIFA (Text-to-Image Faithfulness evaluation with question Answering) question generator. Given an image description, create exactly 4 visual verification questions with multiple choice answers. Each question should test different visual aspects that can be verified by looking at the image.
Guidelines:
- Focus on colors, shapes, objects, materials, spatial relationships, and other visually verifiable elements
- Mix yes/no questions (2 choices: "no", "yes") and multiple choice questions (4 choices)
- Each question should test a DIFFERENT aspect of the description
- Ensure questions can be answered by visual inspection of the image
- Use elements explicitly mentioned in the description
- Include both positive verification (testing presence, answer: "yes") and negative verification (testing absence, answer: "no")
- Make distractors realistic and relevant to the domain
Format each question as:
Q[number]: [question text]
C: [comma-separated choices]
A: [correct answer]
Generate questions that test visual faithfulness between the description and image."""
# Generate evaluation questions
description = "a lighthouse overlooking the ocean"
prompt = (
"<s>[INST] <<SYS>>\n"
f"{system_msg}\n"
"<</SYS>>\n\n"
f'Create 4 visual verification questions for this description: "{description}" [/INST]'
)
output = pipe(prompt)[0]['generated_text']
response = output[len(prompt):]
print(response)
For "a lighthouse overlooking the ocean":
Q1: What type of structure is prominently featured in the image?
C: windmill, lighthouse, castle, tower
A: lighthouse
Q2: What body of water is the lighthouse overlooking?
C: lake, river, ocean, pond
A: ocean
Q3: Are there any mountains visible in the scene?
C: no, yes
A: no
Q4: Is the lighthouse positioned to overlook a body of water?
C: no, yes
A: yes
| Aspect | Llama2-TIFA-AWQ | SmolLM2 Series |
|---|---|---|
| Starting point | TIFA-specialized model | General instruction models |
| Domain knowledge | ✅ Pre-existing TIFA expertise | ⭐ Learned during fine-tuning |
| Model size | ~7B parameters (AWQ quantized) | 135M - 1.7B parameters |
| Inference speed | ~8 seconds (AWQ optimized) | ~3 seconds (small models) |
| Training approach | Structural refinement + quantization | Full task learning |
| Memory efficiency | ✅ AWQ quantized | ⭐ Naturally smaller |
| Question quality | ✅ Deep domain knowledge | ⭐ Systematic structure |
@misc{llama2-tifa-refined-2025,
title={Llama2-TIFA: Structural Refinement of LLaMA 2 for Text-to-Image Faithfulness Assessment},
author={kawchar85},
year={2025},
url={https://huggingface.co/kawchar85/Llama2-TIFA-AWQ},
note={Fine-tuned from tifa-benchmark/llama2_tifa_question_generation}
}
This model complements the broader TIFA question generation ecosystem:
Specialized TIFA models:
General→TIFA models: