Instructions to use sag-uniroma2/FrameLLaMA-3.1-8B-Instruct-FullFN17 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sag-uniroma2/FrameLLaMA-3.1-8B-Instruct-FullFN17 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="sag-uniroma2/FrameLLaMA-3.1-8B-Instruct-FullFN17") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("sag-uniroma2/FrameLLaMA-3.1-8B-Instruct-FullFN17") model = AutoModelForCausalLM.from_pretrained("sag-uniroma2/FrameLLaMA-3.1-8B-Instruct-FullFN17", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use sag-uniroma2/FrameLLaMA-3.1-8B-Instruct-FullFN17 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "sag-uniroma2/FrameLLaMA-3.1-8B-Instruct-FullFN17" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sag-uniroma2/FrameLLaMA-3.1-8B-Instruct-FullFN17", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/sag-uniroma2/FrameLLaMA-3.1-8B-Instruct-FullFN17
- SGLang
How to use sag-uniroma2/FrameLLaMA-3.1-8B-Instruct-FullFN17 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "sag-uniroma2/FrameLLaMA-3.1-8B-Instruct-FullFN17" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sag-uniroma2/FrameLLaMA-3.1-8B-Instruct-FullFN17", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "sag-uniroma2/FrameLLaMA-3.1-8B-Instruct-FullFN17" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sag-uniroma2/FrameLLaMA-3.1-8B-Instruct-FullFN17", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Desktop
- Docker Model Runner
How to use sag-uniroma2/FrameLLaMA-3.1-8B-Instruct-FullFN17 with Docker Model Runner:
docker model run hf.co/sag-uniroma2/FrameLLaMA-3.1-8B-Instruct-FullFN17
Part of FrameLLaMA — ACL 2026
This model is part of FrameLLaMA, a framework that injects frame-semantic knowledge from FrameNet 1.7 into Llama-3.1-8B-Instruct with LoRA, and tests whether this knowledge improves event-level reasoning.
- 📄 Paper: Frame-Semantic Knowledge Injection for Event-Level Inference in LLMs, Shahid Iqbal Rai, Danilo Croce, Roberto Basili. ACL 2026.
- 💻 GitHub repository: https://github.com/crux82/FrameLLaMA
- 🤗 Training data: https://huggingface.co/datasets/sag-uniroma2/FrameLLaMA-FullFN17-Instructions
- 🔗 Follow-up (English, Italian, Urdu, Findings of EACL 2027): code · data. This model is the English-only model of that study.
Task Description
Llama-3.1-8B-Instruct fine-tuned on question–answer data built from the full FrameNet 1.7 inventory. Instead of memorising isolated facts, the training data teach the principles behind frames: what situation a frame describes, which participants (frame elements) it has and what they can be, which words evoke it, and how frames relate to each other. Natural language inference (NLI) is used to test whether this knowledge transfers to event-level reasoning, and semantic role labeling (SRL) to test frame and role sensitivity.
Dataset Summary
- Total samples: more than 491,000 instruction–answer pairs
- Frames: the full FrameNet 1.7 inventory (1,221 frames)
- Task families: 40, with open, yes/no and multiple-choice questions
- Content: frame definitions, frame elements and their semantic types, lexical units and their senses, annotated examples, frame-to-frame relations (inheritance, perspective, uses, subframe, precedes, causative, inchoative)
- Negative examples: sampled from other frames and filtered by sentence-embedding similarity (cosine < 0.50)
Every instance has the fields Instruction, Question, Answer and Task Family.
Model
| Base model | meta-llama/Llama-3.1-8B-Instruct, trained on its 4-bit Unsloth build |
| Adaptation | LoRA, rank 8, alpha 16, dropout 0.1, on all attention and MLP projections |
| Training | 10 epochs, learning rate 5e-6, effective batch size 32, AdamW 8-bit, no validation set |
| Training prompt | Alpaca format (### Instruction: / ### Input: / ### Response:) |
| Checkpoint | LoRA adapter merged into the base model (16-bit weights) |
Training configuration: configs/acl2026.yaml in the GitHub repository.
Performance
Results reported in the paper (accuracy for NLI, F1 for SRL). Values better than the base model are in bold.
| Task | Setting | Base (Llama-3.1-8B-Instruct) | This model |
|---|---|---|---|
| NLI: CONFER | Zero-shot | 0.52 | 0.55 |
| NLI: CONFER | Few-shot | 0.39 | 0.75 |
| NLI: SNLI diagnostic subset | Zero-shot | 0.60 | 0.62 |
| NLI: SNLI diagnostic subset | Few-shot | 0.73 | 0.77 |
| SRL: lexical unit identification | Zero-shot | 0.50 | 0.62 |
| SRL: frame prediction | Zero-shot | 0.66 | 0.81 |
| SRL: frame elements, roles only | Zero-shot | 0.17 | 0.34 |
| SRL: frame elements, one-word overlap | Zero-shot | 0.13 | 0.23 |
The gains are largest for entailment and contradiction. These are frame-semantic and event-level evaluations, not general-purpose benchmarks (such as MMLU or ARC). Class-wise results and other baselines (gpt-oss-20B, Gemma, DeepSeek-R1-Distill) are in the paper.
How to use
The model is used with plain-text prompts (no chat template), as in the paper. Zero-shot NLI with the prompt used in the evaluation:
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
MODEL_ID = "sag-uniroma2/FrameLLaMA-3.1-8B-Instruct-FullFN17"
dtype = torch.bfloat16 if torch.cuda.is_bf16_supported() else torch.float16
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)
model = AutoModelForCausalLM.from_pretrained(MODEL_ID, torch_dtype=dtype, device_map="auto")
model.eval()
PROMPT = """Judge if the hypothesis necessarily follows from the premise.
Consider the truth value of the premise. If the premise is true, does it necessarily mean that the hypothesis must also be true?
Output E if the hypothesis must always be true.
Output C if the hypothesis must always be false.
Output N if the hypothesis may be either true or false.
Do not output anything other than letters E, C, or N.
Premise: {premise}
Hypothesis: {hypothesis}
# Output:"""
prompt = PROMPT.format(premise="John drowned Martha.", hypothesis="Martha died.")
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
with torch.inference_mode():
output = model.generate(**inputs, max_new_tokens=2, do_sample=False,
pad_token_id=tokenizer.eos_token_id)
answer = tokenizer.decode(output[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True).strip()
label = {"E": "entailment", "C": "contradiction", "N": "neutral"}.get(answer[:1].upper(), answer)
print(label) # expected: entailment
The model answers with one letter: E (entailment), C (contradiction) or N (neutral). The full evaluation (CONFER, SNLI, SRL, with vLLM) is in the GitHub repository; the demo can also be run directly:
git clone https://github.com/crux82/FrameLLaMA && cd FrameLLaMA
pip install -r requirements.txt
python examples/nli_demo.py
Intended Use and Limitations
Intended for research on frame semantics and event-level reasoning: NLI involving event structure and participant roles, frame identification and semantic role labeling. It is not intended as a general-purpose assistant: the adaptation targets frame-semantic competence, and general abilities were not evaluated. The training data are in English; for Italian and Urdu see the multilingual follow-up.
Citation
@inproceedings{rai-etal-2026-frame,
title = "Frame-Semantic Knowledge Injection for Event-Level Inference in {LLM}s",
author = "Rai, Shahid Iqbal and
Croce, Danilo and
Basili, Roberto",
editor = "Liakata, Maria and
Moreira, Viviane P. and
Zhang, Jiajun and
Jurgens, David",
booktitle = "Proceedings of the 64th Annual Meeting of the {A}ssociation for {C}omputational {L}inguistics (Volume 2: Short Papers)",
month = jul,
year = "2026",
address = "San Diego, California, United States",
publisher = "Association for Computational Linguistics",
url = "https://aclanthology.org/2026.acl-short.55/",
doi = "10.18653/v1/2026.acl-short.55",
pages = "664--678",
ISBN = "979-8-89176-391-3"
}
License
This model is derived from Llama 3.1 and is subject to the Llama 3.1 Community License. Built with Llama. Trained with Unsloth and Hugging Face TRL.
- Downloads last month
- 938
Model tree for sag-uniroma2/FrameLLaMA-3.1-8B-Instruct-FullFN17
Base model
meta-llama/Llama-3.1-8B