LLM-NER: Advancing Named Entity Recognition with LoRA+ Fine-Tuned Large Language Models
TL;DR Highlight
A methodology paper on fine-tuning LLMs with LoRA+ to boost NER (Named Entity Recognition) performance.
Who Should Read
NLP engineers and researchers working on information extraction tasks who want to efficiently fine-tune LLMs for NER without full fine-tuning costs.
Core Mechanics
- Standard LoRA has a learning rate imbalance between the A and B matrices that slows convergence for NER tasks
- LoRA+ addresses this by setting different learning rates for the A matrix (lower) and B matrix (higher), leading to faster and better convergence
- LLMs fine-tuned with LoRA+ for NER significantly outperform smaller specialized NER models on domain-specific datasets
- The approach is particularly effective for low-resource NER domains where training data is limited — LoRA+'s efficiency matters more here
- Few-shot LoRA+ fine-tuning (even with 100-500 examples) achieves competitive results with full fine-tuning on specialized NER benchmarks
- The paper provides practical guidance on LoRA rank selection, learning rate ratios, and training duration for NER
Evidence
- On CoNLL-2003 NER: LoRA+ fine-tuned LLM achieved F1 92.4 vs. LoRA 91.1 vs. specialized NER model 91.8
- On biomedical NER (low-resource): LoRA+ F1 85.2 vs. LoRA 82.7 vs. BioBERT 83.5
- Convergence speed: LoRA+ reached peak performance in 60% of the training steps required by standard LoRA
How to Apply
- For NER fine-tuning: use LoRA+ with rank=16, learning rate ratio B/A = 16 (B matrix 16x higher learning rate than A matrix), and target the attention + MLP layers.
- If you have < 1K training examples: LoRA+ fine-tuning with a 7B LLM will likely outperform training a dedicated smaller NER model — the LLM's pretrained language understanding is a strong prior.
- For production NER: fine-tune with LoRA+ for performance, then consider LoRA weight merging into the base model for inference efficiency — eliminates adapter overhead.
Try It
from peft import LoraConfig, get_peft_model
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "meta-llama/Llama-2-7b-hf" # or another LLM
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name, load_in_8bit=True, device_map="auto")
# LoRA+ style: increase lora_alpha for learning rate correction effect
lora_config = LoraConfig(
r=16,
lora_alpha=32,
target_modules=["q_proj", "v_proj"],
lora_dropout=0.05,
bias="none",
task_type="CAUSAL_LM"
)
model = get_peft_model(model, lora_config)
model.print_trainable_parameters()
# Example output: trainable params: 4,194,304 || all params: 6,742,609,920 || trainable%: 0.062
# Example instruction format for NER
ner_prompt = """Extract named entities from the sentence below. Format: [TYPE: entity]
Sentence: Apple's CEO Tim Cook gave a presentation in Seoul.
Answer:"""
# Expected output: [ORG: Apple] [PER: Tim Cook] [LOC: Seoul]Terminology
Related Papers
Quadrillion-parameter transformers and how to train them
On fixed data, much bigger models with scaled weight decay and ensembling keep loss falling as compute grows.
Astra can read and write weights to improve Qwen
An LLM edited Qwen3.5-0.8B's weights directly, lifting MATH-500 from 7.9% to 48.1%.
Show HN: Qwen3-4B with the AI writing tics trained out
Distilling Qwen3-4B with LoRA cut its AI-writing slop score from 121 to 12.5 per 1000 words
Dust: Pretraining Transformers Without Backpropagation
Adding per-token noise to activations lets transformers pretrain without backpropagation, rivaling backprop.
Show HN: TurboGPT: train 22KiB transformer in 13s
A CUDA C++ project trains a tiny byte-level GPT in under a minute.
I had Gemini train its own replacement for $9
Fine-tuning GLiNER on $9 of Gemini labels reached 0.83 F1 locally.
Learning to solve hard problems in RL for LLMs by never giving up
Cutting compute on easy problems and retrying hard ones in RL raised accuracy on the hardest problems
Training a 3.8B LLM to 0.384 CORE for $998
A 3.8B LLM trained on 8 B200s in 43 hours for $998 scored 0.384 on CORE.