Downloads · 30 days
0
josuediazflores/insignis-eb1a-lora-comparison
insignis-eb1a-lora-comparison is a text generation model from josuediazflores. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as mit.
LoRA fine-tuned models and a terminal CLI for analyzing EB-1A extraordinary ability visa petitions. Three adapters trained on 1,467 curated AAO appellate decisions, plus a full-featured terminal interface for case man…
Downloads · 30 days
0
Access
Public
Updated Apr 12, 2026
Repo size
323 MB
Likes
0
Public
Click a slice to open those files.
.safetensors139 MB · 47%
From the Hugging Face model README
LoRA fine-tuned models and a terminal CLI for analyzing EB-1A extraordinary ability visa petitions. Three adapters trained on 1,467 curated AAO appellate decisions, plus a full-featured terminal interface for case management, evidence analysis, and AI-powered criteria evaluation grounded in USCIS policy.
Pre-publication research artifact. Part of the alphaXiv x marimo paper "How Much Does Base Model Choice Matter?" Not independently evaluated for production legal use. Don't rely on outputs as legal advice.
Josue Diaz Flores
This repository hosts three LoRA adapters trained on the same EB-1A dataset with identical hyperparameters, so that the only experimental variable is the base model.
josuediazflores/insignis-eb1a-lora-comparison/
├── gemma-4-E4B/ Gemma 4 E4B Instruct + LoRA r16 (best performer)
├── qwen-2.5-7b/ Qwen 2.5 7B Instruct + LoRA r16
├── llama-3.1-8b/ Llama 3.1 8B Instruct + LoRA r16
└── cli/ Insignis Terminal UI source code
Best overall performer. 64.2% outcome prediction accuracy on 260 held-out AAO cases -- a +55 point lift over the 9.2% base model accuracy. This is the default model used by the Insignis CLI.
Strong base model performance (52.3% accuracy without fine-tuning) but LoRA training degraded outcome prediction to 36.5%. Criteria analysis remains competitive.
Modest +6.1 point lift (15.4% to 21.5%). Lowest validation loss of the three (0.8176), but benchmark accuracy trails Gemma significantly.
Evaluated on 260 held-out AAO decisions never seen during training, scoring, or deduplication. Extraction performed independently with Claude Opus.
| Model | Base Accuracy | LoRA Accuracy | Lift |
|---|---|---|---|
| Gemma 4 E4B | 9.2% | 64.2% | +55.0% |
| Qwen 2.5 7B | 52.3% | 36.5% | -15.8% |
| Llama 3.1 8B | 15.4% | 21.5% | +6.1% |
| Model | Base F1 | LoRA F1 | Lift |
|---|---|---|---|
| Gemma 4 E4B | 22.8% | 24.9% | +2.1% |
| Qwen 2.5 7B | 21.0% | 22.9% | +1.9% |
| Llama 3.1 8B | 23.1% | 24.0% | +0.9% |
| Adapter | Base model | Trainable params | Final val_loss | Wall-clock | Hardware |
|---|---|---|---|---|---|
gemma-4-E4B/ | google/gemma-4-E4B-it | 10,895,360 | 1.6702 | 1.3 h | AMD MI300X |
qwen-2.5-7b/ | Qwen/Qwen2.5-7B-Instruct | 10,092,544 | 0.9312 | 9.8 h | Google TPU v4-32 |
llama-3.1-8b/ | meta-llama/Llama-3.1-8B-Instruct | 13,631,488 | 0.8176 | 11.4 h | Google TPU v4-32 |
Note: Gemma's higher absolute loss is due to differences in loss computation (HF Trainer includes padding tokens in denominator). Qualitative output quality is strong across all three.
A full terminal interface for EB-1A petition analysis, built with Ink (React for CLI) and TypeScript.
<!-- Screenshot placeholder: run `npm run dev` and capture the splash screen -->1. Install Ollama
# macOS
brew install ollama
ollama serve
2. Create the Insignis model with the LoRA adapter
Create a Modelfile in your working directory:
FROM gemma-4-E4B-it
ADAPTER ./gemma-4-E4B
Then build it:
ollama create insignis-eb1a -f Modelfile
3. Run the CLI
cd cli
npm install
npm run dev
The CLI defaults to local Ollama at localhost:11434 with model insignis-eb1a.
| Variable | Default | Description |
|---|---|---|
INSIGNIS_MODEL | insignis-eb1a | Ollama model name. Change to use a different adapter. |
INSIGNIS_API_URL | http://localhost:11434 | Inference endpoint. Set to a remote server URL to use GPU cloud. |
Examples:
# Use the Qwen adapter instead
INSIGNIS_MODEL=insignis-qwen npm run dev
# Point at a remote GPU server
INSIGNIS_API_URL=http://your-gpu-server:8000 npm run dev
| Command | Description |
|---|---|
/browse | Browse saved cases |
/analyze | Start AI analysis of the current case |
/files | Manage evidence files attached to a case |
/help | Show all available commands |
All three adapters are trained on the same curated dataset.
4,643 raw AAO decisions
-> quality scoring + filtering
1,467 curated cases
-> 4 task types x 10 criteria
13,083 ChatML training examples
josuediazflores/aao-eb1a-chatml| Parameter | Value |
|---|---|
| LoRA rank (r) | 16 |
| LoRA alpha | 32 |
| LoRA dropout | 0.05 |
| LoRA bias | none |
| Target modules | q_proj, k_proj, v_proj, o_proj |
| Max sequence length | 1024 |
| Effective batch size | 16 |
| Epochs | 3 |
| Optimizer | AdamW |
| Learning rate | 2e-4 |
| Precision | bfloat16 |
Trained with HuggingFace PEFT. Qwen and Llama used a custom PyTorch + torch_xla 2.5 loop on TPU v4-32. Gemma used the HuggingFace Trainer on AMD MI300X due to torch_xla incompatibilities with its multimodal architecture.
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
import torch
BASE_MODEL = "google/gemma-4-E4B-it"
ADAPTER_SUBFOLDER = "gemma-4-E4B"
tokenizer = AutoTokenizer.from_pretrained(BASE_MODEL)
base = AutoModelForCausalLM.from_pretrained(
BASE_MODEL, torch_dtype=torch.bfloat16, device_map="auto"
)
model = PeftModel.from_pretrained(
base,
"josuediazflores/insignis-eb1a-lora-comparison",
subfolder=ADAPTER_SUBFOLDER,
)
model.eval()
MIT
@misc{diazflores2026insignis,
title = {How Much Does Base Model Choice Matter? A Three-Way Comparison of LoRA Fine-Tuning on Domain-Specific Legal Reasoning},
author = {Diaz Flores, Josue},
year = {2026},
note = {alphaXiv x marimo competition entry},
url = {https://github.com/josuediazflores/ProjectGreenlight}
}