Models

Models describe a problem, its assumptions, uncertainty and acceptable conclusions.

Accounting Invariants as Enforceable Checks in a Financial System

A practical guide to designing enforceable accounting invariants: from PostgreSQL schema constraints and double-entry balance per currency to concurrent debit control, immutability of postings, external reconciliation, and testing. The article separates the mathematical guarantees of the ledger, business policies, and financial reporting requirements.

2026.11.17

Constrained optimization: how to formalize a choice instead of picking it by hand

How to turn a practical choice into a model: decision variables, an objective function, hard and soft constraints. A checkable numerical example shows the difference between a feasible and an optimal solution, between fractional and integer choice, and the effect of the penalty weight. Here, optimum always means the best solution within the given model.

2026.10.19

How a Language Model Works: The Path from Tokens to an Answer

A step-by-step analysis of how an autoregressive language model works: tokenization using the verifiable example “2 + 2 = 4” in the r50k_base encoding, vector representations and position, the attention mechanism with a causal mask, Transformer blocks, next-token probabilities, and the rules used to choose a token. The article also examines the differences between training and inference, as well as practical limits: the context window, factual errors, memorization of training data, and architectural differences.

2026.10.01

When Classical Models Are Preferable to LLMs for Structured Financial Data

For numerical classification, regression, scoring, and forecasting on financial tables, classical statistical models, Random Forest, and especially GBDT should usually be evaluated before LLMs. They are preferable with limited samples, a fixed feature schema, and strict requirements for arithmetic accuracy, calibration, latency, reproducibility, and auditability. LLMs provide more value at the language boundary of the task – working with reports, natural-language queries, and SQL or Python orchestration – but that is a comparison of systems, not just models.

2026.09.19