NEGABARO AI
A technical encyclopedia of essential AI/ML concepts
π§± Foundation
Neural Network
Connectionist learning model inspired by neurons
A learning method that transforms input data through weights across multiple layers and reduces errors via backpropagation
Transformer
Parallel processing architecture based on Self-Attention
"Attention Is All You Need" β an architecture that overcomes RNN's sequential processing limitations using Self-Attention to process entire input sequences in parallel
AI Preprocessing Difficulty β Text, Image, Audio, Video, 3D in Order of Complexity
model(input) is one line, but the preprocessing to create that input is completely different per domain
AI is always model(input) β output, but preprocessing difficulty varies by domain. Text (tokenization = lookup) is easiest, then image (resize + normalize), audio (STFT + mel), video (frame extraction + temporal), 3D (point cloud + voxel). Start with text.
Text AI Pre-trained Model Catalog β 12 Things You Can Do in 3 Lines of Code
From sentiment analysis to code generation β model list and difficulty for HuggingFace one-liners
Text has the simplest preprocessing (tokenization = lookup table), making it ideal for AI beginners. HuggingFace pipelines enable sentiment analysis, translation, summarization, QA, text generation, code generation, NER, similarity comparison and more in 3 lines. Model recommendations, sizes, and difficulty per task.
HuggingFace pipeline() β How the npm of AI Models Works
1M+ models registered on the Hub, pipeline() auto-downloads by name and runs inference
HuggingFace Hub is the npm of AI models. Anyone can upload models, and pipeline() auto-downloads weights, tokenizer, and config by name. Text, audio, image, video β change the task name and use the same interface for 1M+ models.
Rap AI Model Catalog β Lyrics Generation, Rhyme Detection, and Flow Analysis
GPT-2 rap fine-tuned models + pronouncing rhyme analysis + all runnable code
Several rap lyrics generation models exist on HuggingFace. GPT-2 fine-tuned on rap lyrics runs directly via pipeline(), and the pronouncing library handles rhyme detection and syllable analysis. Lyrics generation β rhyme check β flow analysis, all in code.
ποΈ Training
Pre-training
The stage of learning general knowledge from massive data
The process of acquiring general knowledge β grammar, facts, reasoning β by repeatedly predicting the next token from internet-scale text data
Fine-tuning
Re-training a pre-trained model for specific tasks
The process of further training a pre-trained model's weights on domain or task-specific data to transform a general model into a specialist
RLHF
Reinforcement Learning from Human Feedback
Reinforcement Learning from Human Feedback β human evaluators rank model responses, a reward model is trained on this preference data, then the model is aligned via reinforcement learning (PPO)
DPO (Direct Preference Optimization)
Direct preference optimization without a reward model
A simplified alignment technique that skips RLHF's complex RL pipeline (reward model + PPO) and directly updates the LLM from preference data
LoRA (Low-Rank Adaptation)
Efficient fine-tuning that trains only a small number of parameters
A technique that freezes original model weights and adds two low-rank matrices for fine-tuning effects with minimal parameters, dramatically saving GPU memory
Inference vs Fine-tuning β Using Someone Else's Model vs Making Your Own
pipeline() is ordering delivery, fine-tuning is taking a recipe and adjusting seasoning to your taste
Inference is using someone else's trained model. Fine-tuning is retraining that model with your data to create your own. Fine-tuning doesn't train from scratch β it slightly adjusts an already well-trained base model, doable on a single laptop GPU. Sentiment analysis is the best starting point.
The Simplest Fine-tuning Guide in the World β It's Adjusting, Not Merging
Slightly adjusting 66M numbers. Not injecting data into a model, not merging models together
Fine-tuning isn't merging data into a model or adding models together. It's slightly adjusting the weights (66M numbers) of a completed model while showing it your data. Like giving OJT to a college graduate β not re-reading textbooks, but teaching new job skills on top of existing knowledge.
LoRA β Don't Change All 66M, Just Plug In a 1M Adapter
Efficient alternative to fine-tuning β freeze the base model, train just two small matrices
Fine-tuning adjusts all 66M numbers. LoRA freezes the base model and trains only a small adapter (1M) alongside it. Similar quality, much less training time, memory, and storage. Like putting a case on your phone β you don't change the phone itself, just swap cases.
RAG β Giving the Model Reference Materials Without Retraining
Retrieval + Generation β attach external knowledge to prompts without changing model weights
RAG (Retrieval-Augmented Generation) doesn't change model weights at all. Instead, when a question comes in, it retrieves relevant documents and attaches them to the prompt before passing to the model. Like bringing open-book reference materials to an exam. Unlike fine-tuning, when data changes you just update the documents.
Model Merging β The Only Way to Actually "Add" Two Models Together
Korean model + coding model = model that codes in Korean? Merge by averaging weights
Model merging is the only technique in AI that truly qualifies as "adding." Average the weights of two models into one. Merge a Korean model and a coding model, you might get a model that codes in Korean. No training needed, no GPU required. But it's experimental β results aren't guaranteed.
β‘ Inference
Prompt Engineering
Maximizing LLM capabilities through prompt design
The art of designing optimal inputs (prompts) to guide LLMs toward desired outputs. Maximizes performance through input alone without changing model weights
RAG (Retrieval-Augmented Generation)
Improving accuracy by injecting external knowledge through retrieval
A method where LLMs retrieve relevant documents from a vector DB before generating answers, appending them to the prompt. Enables use of latest/specialized knowledge not in training data
Chain-of-Thought (CoT)
Solving complex problems through step-by-step reasoning
A prompting technique that instructs the LLM to "think step by step," explicitly generating intermediate reasoning steps. Dramatically improves performance on complex math, logic, and coding problems
Function Calling (Tool Use)
LLMs call external tools to perform real-world tasks
A capability where LLMs output structured function calls (JSON) instead of text, executing external APIs/DBs/calculators and utilizing results. The core mechanism of AI Agents
π Scaling & Optimization
Quantization
Lightening models by converting weights to lower precision
An optimization technique that converts model weights stored in FP32 (32-bit) or FP16 (16-bit) to INT8 (8-bit) or INT4 (4-bit), reducing model size and memory usage by 1/2 to 1/8
Knowledge Distillation
Transferring knowledge from large models to small models
A technique that trains a small model (Student) to mimic the output distribution (soft labels) of a large model (Teacher), bringing small model performance close to large models
Mixture of Experts (MoE)
Efficient scaling by activating only needed experts
An architecture that activates only a subset of expert networks instead of one massive model. Total parameters are large but actual computation uses only a portion
Speculative Decoding
Small model drafts predictions, large model verifies
A technique where a fast small model (Draft Model) generates multiple tokens at once, and a slow large model (Target Model) verifies/corrects them all at once, improving inference speed by 2-3x
π¨ Multimodal
Vision-Language Model
AI that understands both images and text together
Multimodal AI combining an image encoder (ViT) with an LLM to describe images or answer questions about them
Diffusion Model
Generating images by progressively removing noise
A technique that learns to reverse the process of gradually adding noise to images, starting from pure noise and progressively denoising to generate images
Text-to-Speech (TTS)
Converting text to natural-sounding speech
Technology for converting text input into natural, expressive speech. Recently combined with LLMs to naturally handle emotions, intonation, and multiple languages
π€ Agent & Tool Use
AI Agent
LLMs autonomously plan and use tools to complete tasks
A system using LLMs as the "brain," repeating plan β tool call β observe result β decide next action to autonomously perform complex tasks
MCP (Model Context Protocol)
Standard protocol connecting AI to external tools
An open protocol by Anthropic that connects AI models to external tools (DB, files, APIs) in a standardized way. Like USB-C, "one standard to connect all tools"
Eval-Driven Development
Iteratively improving AI systems based on evaluation (Eval)
A development methodology that measures the impact of changes to prompts, models, RAG pipelines, etc. through automated evaluation (Eval) and improves based on data
π‘οΈ Safety & Alignment
AI Alignment
Making AI act in accordance with human intent and values
A research field ensuring AI systems behave as humans intend. Aims for systems that are "Helpful, Harmless, and Honest"
Constitutional AI (CAI)
A method to improve AI itself using a constitution (principles)
An alignment technique developed by Anthropic. Instead of direct human feedback, AI is given a "constitution (principles)" to critique and revise its own responses, greatly reducing the human labor of RLHF
Hallucination
The phenomenon of AI generating plausible but false content
The phenomenon where LLMs confidently generate information that is not in training data or is factually incorrect. Stems from the inherent limitation of next-token prediction learning
ποΈ Speech & Audio AI
Audio Tokenization (Neural Audio Codec)
Converting audio into discrete tokens for LLM-like processing
Technology that converts continuous audio waveforms into discrete token sequences using VQ-VAE based codecs (EnCodec, SoundStream, etc.), enabling generation and understanding via Transformers like text
Evolution of Speech Models
Rule-based β Deep learning pipeline β Token-based β Unified multimodal
History of TTS technology evolution: 1st gen (rule/concatenative synthesis) β 2nd gen (statistical parametric) β 3rd gen (deep learning mel spectrogram pipeline) β 4th gen (token-based LLM approach) β future (unified multimodal)
GPT-SoVITS Practical Analysis
How Pre-training and Fine-tuning work in actual code
A case study analyzing how Pre-training and Fine-tuning are implemented in actual code through the GPT-SoVITS open-source project
Demucs Code Analysis β How One Song Gets Split into Vocals, Drums, Bass, and Guitar
Meta/Facebook Research's Hybrid Transformer source separation model β architecture, inference pipeline, real-world usage
Demucs is an open-source music source separation model by Meta (Facebook Research). It splits a complete song into 4 stems: vocals, drums, bass, and other. The current version htdemucs combines a time-domain encoder-decoder with a frequency-domain Transformer in a hybrid architecture.
Mel-Band RoFormer Karaoke Model β How 913MB Isolates Lead Vocals Only
RoPE + mel-scale frequency decomposition + hierarchical time-freq Transformer β with code and config
The Mel-Band RoFormer Karaoke model by UVR community's aufr33+viperx is a 913MB PyTorch checkpoint. A karaoke-specific model that isolates lead vocals while keeping backing vocals in the instrumental. 60 mel bands decompose frequencies, and a hierarchical Transformer alternating between time and frequency axes is the core. SDR 10.1956.
UVR Mel-Band RoFormer vs Demucs β Music Source Separation Model Comparison
Karaoke-specific 2-stem vs general-purpose 4-stem β architecture, training, performance, selection criteria
Comparison of the two most popular source separation models. UVR Mel-Band RoFormer Karaoke is a 913MB karaoke-specific model isolating lead vocals only, while Demucs htdemucs is an 80MB general-purpose model splitting into 4 stems. Different tools for different jobs.
Vocal Separation in 2 Minutes β Running Demucs and UVR Karaoke Locally
Hands-on comparison β installation, execution, processing time, and output from actual runs
Installed and ran both Demucs and UVR Karaoke locally. Demucs: one pip install + one command, 80MB model, 10s audio in 10s. UVR Karaoke: 913MB model, same audio in 43s. Demucs is simpler; UVR has better karaoke quality.
Audio AI Foundations β What Demucs, Mel-Band RoFormer, and GPT-SoVITS Share
STFT spectrograms, Transformer attention, encoder-decoder, PyTorch β the shared DNA of audio AI
Source separation (Demucs, Mel-Band RoFormer) and voice synthesis (GPT-SoVITS) have different goals but share the same foundation. STFT converts audio to frequency domain, Transformers capture long-range dependencies, encoder-decoders decompose and reconstruct. Understanding this shared DNA unlocks all of audio AI.
Audio AI Hello World β 7 Projects in 5 Minutes with Pre-trained Models
One pip install + 3 lines of code for source separation, speech recognition, TTS, pitch detection, and music generation
No training, no GPU, 3 lines of code. Source separation, speech recognition, TTS, pitch detection, music tagging, sound classification, music generation β all using pre-trained model downloads with immediate results.
input β pre-trained model β output β The Essence of AI Inference in One Line
Forget STFT and masking β the model does exactly one thing: take input, produce output
In audio AI pipelines, STFT, masking, and ISTFT are all math. The neural network does exactly one line β model(input) produces output. Source separation, speech recognition, TTS, sound classification all follow this structure.
π OCR & Document AI
OCR Open Source Catalog β Every Way to Extract Text from Images
From Tesseract to EasyOCR, PaddleOCR, Surya, TrOCR, Qwen2-VL β difficulty, language, speed comparison
OCR is entirely a neural network domain. Image β model(image) β text. From the easiest EasyOCR (3 lines, 80 languages) to CJK-strongest PaddleOCR, latest high-precision Surya, Transformer-based TrOCR, and multimodal LLMs (Qwen2-VL).
PDF-Specialized OCR β Tools That Convert Complex Layouts, Tables, and Equations to Markdown
Marker, Docling, MinerU, Nougat, olmOCR β making PDFs readable for LLMs
Regular OCR extracts text from images, but PDFs are more complex β multi-column layouts, tables, equations, code blocks, headers/footers. PDF-specialized tools understand this structure and convert to Markdown/JSON. Essential first step for RAG pipelines.
Contract & Legal Document OCR β Clause Extraction, Party Identification, Structuring
Legal-BERT + LayoutLMv3 + CUAD dataset to convert contracts into structured data
Contract OCR is less about extracting text and more about what you extract FROM the text. OCR (text extraction) β Legal-BERT (legal language understanding) β clause classification, party identification, deadline extraction. Fine-tunable with CUAD dataset (500 contracts, 41 labels).
Japanese-Specialized OCR β Manga, Vertical Text, Furigana, and Historical Documents
manga-ocr, Sarashina2.2-OCR, PaddleOCR, KuroNet β every option for Japanese OCR
Why Japanese OCR is hard: vertical text (tategaki), furigana, mixed hiragana/katakana/kanji, manga-specific fonts. manga-ocr (manga-specific), Sarashina2.2-OCR (best Japanese document accuracy), PaddleOCR (general CJK), KuroNet (historical kuzushiji).
OCR Fine-tuning Guide β Building Your Own Model That Reads Japanese Real Estate Contracts
TrOCR + Trainer.train() β exactly the same pattern as sentiment analysis fine-tuning
OCR fine-tuning has the same structure as sentiment analysis fine-tuning. Input changed from text to image, but adjusting model weights with Trainer.train() is identical. TrOCR (ViT encoder + text decoder) is easiest β standard HuggingFace interface.
OCR API Catalog β Extract Text with One API Call, No Model Management
Google Vision, Azure Document Intelligence, AWS Textract, Clova OCR β price, accuracy, code comparison
OCR without installing or managing models β just API calls. Google Cloud Vision (highest accuracy), Azure Document Intelligence (contract/receipt specialized), AWS Textract (strong table extraction), Naver Clova OCR (best Korean) β code examples and pricing compared.
Japanese Contract OCR Benchmark β API vs Open Source, Which Is Better?
Google Vision, Azure, PaddleOCR, Sarashina2.2 β accuracy, speed, price comparison on Japanese contracts
Comparing API (Google Vision, Azure) and open-source (PaddleOCR, Sarashina2.2-OCR, manga-ocr) performance on Japanese real estate contracts. Accuracy: Google Vision β Sarashina2.2 > PaddleOCR > Azure > EasyOCR. Cost: open-source $0 vs API per-page billing.
OCR Comprehensive Comparison β API vs Open Source vs Fine-tuning, What Should You Use?
Accuracy, cost, security, difficulty, and maintenance of 3 approaches in one chart
3 ways to implement OCR: API calls (Google Vision, etc.), open-source self-hosting (EasyOCR, PaddleOCR, etc.), fine-tuning (TrOCR, manga-ocr). Comparing across 5 axes β accuracy, cost, security, difficulty, maintenance β the optimal choice varies by situation.
Azure Document Intelligence Pre-built Models β All 15 Models from Receipts to Contracts
prebuilt-read, prebuilt-receipt, prebuilt-contract, prebuilt-invoice β change model name, get structured data
Azure Document Intelligence isn't just OCR. It has 15+ pre-built models per document type. Feed a receipt, get store name, date, amount. Feed a business card, get name, title, phone. Feed a contract, get parties, jurisdiction, clauses. All as structured JSON. Just change the model name.
Structured Document Extraction API Comparison β What Azure, Google, AWS Each Offer
Does Google and AWS have "document understanding APIs" like Azure prebuilt-contract?
APIs that structurally extract fields per document type β like Azure's prebuilt-contract β exist in Google (Document AI) and AWS (Textract) too. But supported document types, languages, and pricing all differ. Azure has the most specialized models, Google has strong custom processors, AWS specializes in table extraction.
π Evaluation & Validation
AI Model Evaluation Guide β How Do You Know Your Model Is Good?
Accuracy, BLEU, CER, SDR β different metrics per task and why each is used
After training, you need to evaluate. But each task has different metrics. Classification uses accuracy, generation uses BLEU, OCR uses CER, source separation uses SDR. All boil down to one number β higher is better, or lower is better.
Evaluation Cheat Sheet by Task β Which Metric to Use at a Glance
ClassificationβAccuracy/F1, GenerationβBLEU/ROUGE, OCRβCER/WER, SeparationβSDR β with code
Different tasks need different metrics. Use this cheat sheet to pick the right metric for your task and measure it in 3 lines of code.
AI Evaluation Tools Catalog β evaluate, lm-eval-harness, RAGAS, DeepEval
From single metric measurement to LLM benchmarks, RAG evaluation, and automated testing pipelines
From simple metric measurement (evaluate) to LLM benchmarks (lm-eval-harness), RAG pipeline evaluation (RAGAS), and AI app testing (DeepEval) β evaluation tools differ by purpose.