Downloads · 30 days
6
26% of all-time downloads
maytemuma/llamax3-8b-lora-fewshot
llamax3-8b-lora-fewshot is a text generation model from maytemuma. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as apache-2.0.
LoRA fine-tuned adapter for LLaMAX3-8B trained with a few-shot prompt format for syllogistic validity classification. Designed for SemEval 2026 Task 11 (Logical Reasoning with Content Effect).
Downloads · 30 days
6
26% of all-time downloads
All-time downloads
23
Public
Repo size
688 MB
Likes
0
Public
Click a slice to open those files.
.safetensors671 MB · 97%
From the Hugging Face model README
LoRA fine-tuned adapter for LLaMAX3-8B trained with a few-shot prompt format for syllogistic validity classification. Designed for SemEval 2026 Task 11 (Logical Reasoning with Content Effect).
This adapter is fine-tuned on LLaMAX3-8B using a consistent few-shot training prompt containing two in-context examples (one valid and one invalid) followed by the target syllogism. It achieves strong performance and a low content effect when used with the same few-shot pattern at inference time.
{ "r": 64, "lora_alpha": 128, "target_modules": [ "q_proj", "k_proj", "v_proj", "o_proj", "gate_proj", "up_proj", "down_proj" ], "lora_dropout": 0.05, "bias": "none", "task_type": "CAUSAL_LM" }
Trainable parameters: 167M of 8.1B total (~2.06%)
| Metric | Value |
|---|---|
| Accuracy | 86.3% |
| Content Effect (total) | 0.056 |
| Ranking Score | 15.45 |
| Intra-Plausibility CE | 0.0757 |
| Cross-Plausibility CE | 0.0360 |
| Model | Accuracy | Content Effect | Ranking Score |
|---|---|---|---|
| Zero-shot trained + few-shot inference | 87.5% | 0.058 | 15.03 |
| Few-shot trained + few-shot inference (this) | 86.3% | 0.056 | 15.45 |
pip install transformers peft torch
import torch from transformers import AutoModelForCausalLM, AutoTokenizer from peft import PeftModel
Load base model and tokenizer base_id = "LLaMAX/LLaMAX3-8B" base_model = AutoModelForCausalLM.from_pretrained( base_id, torch_dtype=torch.bfloat16, device_map="auto" ) tokenizer = AutoTokenizer.from_pretrained(base_id) if tokenizer.pad_token is None: tokenizer.pad_token = tokenizer.eos_token
Load LoRA adapter model = PeftModel.from_pretrained( base_model, "maytemuma/llamax3-8b-lora-fewshot" ) model.eval()
def classify_syllogism(syllogism: str, model, tokenizer) -> bool: """ Returns True for 'valid', False for 'invalid'. """ prompt = f"""Task: Determine if logical arguments are valid or invalid.
Example 1: Syllogism: All dogs are animals. All animals are living things. Therefore, all dogs are living things. Answer: valid
Example 2: Syllogism: No cats are dogs. Some animals are dogs. Therefore, some animals are cats. Answer: invalid
Example 3: Syllogism: {syllogism} Answer:"""
inputs = tokenizer(prompt, return_tensors="pt").to(model.device) with torch.no_grad(): outputs = model.generate( **inputs, max_new_tokens=5, temperature=0.7, do_sample=True, top_p=0.9, pad_token_id=tokenizer.eos_token_id ) response = tokenizer.decode( outputs[inputs["input_ids"].shape:],[1] skip_special_tokens=True ).strip().lower()
if response.startswith("valid") and "invalid" not in response[:10]: return True if "invalid" in response[:15]: return False return False
Task: Determine if logical arguments are valid or invalid.
Example 1: Syllogism: All dogs are animals. All animals are living things. Therefore, all dogs are living things. Answer: valid
Example 2: Syllogism: No cats are dogs. Some animals are dogs. Therefore, some animals are cats. Answer: invalid
Example 3: Syllogism: {syllogism} Answer: {label}
{ "learning_rate": 2e-4, "num_epochs": 10, "batch_size": 4, "gradient_accumulation_steps": 4, "warmup_ratio": 0.1, "weight_decay": 0.01, "max_seq_length": 768, "optimizer": "adamw_torch", "lr_scheduler": "cosine", "bf16": true, "early_stopping_patience": 3 }
Note: max_seq_length was set to 768 to accommodate longer few-shot prompts safely.
@misc{llamax3-syllogistic-fewshot-2025, author = {Maria Teresa Muñoz Martin}, title = {LLaMAX3-8B LoRA for Syllogistic Reasoning (Few-shot Training)}, year = {2025}, publisher = {Hugging Face}, howpublished = {\url{https://huggingface.co/maytemuma/llamax3-8b-lora-fewshot}}, note = {SemEval 2026 Task 11: Logical Reasoning with Content Effect} }
Apache-2.0. This adapter inherits the license terms compatible with its base model.