AI & Developer Tips
Short, practical explanations and tools for AI, Linux, and everyday development.
2026
- Use left padding and an attention mask for LLM batches
- Budget memory for a 4-bit LLM
- Choose a retrieval threshold for cosine similarity
- model.eval() vs no_grad(): what changes during inference?
- Hybrid search for RAG: BM25 plus embeddings, measured on 1,000 questions
- Reranking for RAG: a cross-encoder lifted top-1 retrieval from 64% to 85%
- Speculative decoding, measured on a laptop: 10x fewer model passes, no speedup
- What is a chat template? The string your LLM actually reads
- What is perplexity? Computing it by hand with a small local model
- Orca coordinates Claude Code and Codex for code review
- fp32, fp16, bf16 and int8: what each format stores, and where it breaks
- Greedy decoding vs beam search: why the most likely next word can give a worse answer
- What is a KV cache? Memoization for LLMs, measured: 256 tokens in 7.5 s instead of 34 s
- Do you need a vector database? Exact search vs HNSW on 134,000 real embeddings
- Why do LLMs miscount the r’s in ‘strawberry’? Tokens, a local test, and the fix that works
- 8-bit vs 4-bit LLM quantization in a Qwen quality test
- nohup vs tmux: how to keep a Python job running after SSH disconnects
- Your RAG documents are data, not instructions—and not automatically true
- How do you evaluate LLM answers? Exact match vs key facts vs LLM-as-judge
- How should you chunk documents for RAG? A chunk-size experiment
- What is a context window, and what happens when the input is too long?
- Prompting vs RAG vs fine-tuning: which one do you need?
- RAG explained in 50 lines of Python (with a local model)
- Train, validation and test sets: what overfitting looks like in numbers
- What does temperature do in an LLM? Temperature, top-k and top-p explained
- Why you should always build a baseline model first
- What are embeddings? Semantic search with cosine similarity in Python
- Why is 99% accuracy useless? Precision, recall and F1 explained
- What is a token, and why do LLMs count tokens instead of words?