惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

The Last Watchdog
The Last Watchdog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
GbyAI
GbyAI
Y
Y Combinator Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
The GitHub Blog
The GitHub Blog
博客园_首页
小众软件
小众软件
I
InfoQ
J
Java Code Geeks
月光博客
月光博客
S
Secure Thoughts
Microsoft Security Blog
Microsoft Security Blog
V
Visual Studio Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Stack Overflow Blog
Stack Overflow Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
N
News and Events Feed by Topic
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
The Cloudflare Blog
T
Threat Research - Cisco Blogs
A
About on SuperTechFans
H
Help Net Security
MongoDB | Blog
MongoDB | Blog
博客园 - 聂微东
人人都是产品经理
人人都是产品经理
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Latest news
Latest news
G
GRAHAM CLULEY
IT之家
IT之家
C
Cisco Blogs
Last Week in AI
Last Week in AI
Engineering at Meta
Engineering at Meta
L
LangChain Blog
The Register - Security
The Register - Security
SecWiki News
SecWiki News
M
MIT News - Artificial intelligence
NISL@THU
NISL@THU
T
Tenable Blog
博客园 - Franky
美团技术团队
I
Intezer
U
Unit 42
雷峰网
雷峰网
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
S
SegmentFault 最新的问题
C
Cyber Attacks, Cyber Crime and Cyber Security

Hacker News - Newest: "LLM"

GitHub - lechmazur/position_bias: A benchmark for testing whether LLM judges keep the same preference when two lightly edited versions of the same story are shown in opposite orders. Flex routing (EU and EFTA) Dark Factories: Retooling for LLM Velocity Ask HN: What would be the impact of a LLM output injection attack? GitHub - AronDaron/dataset-generator: No-code desktop app for generating high-quality synthetic datasets to fine-tune LLMs — plan-then-execute pipeline, LLM-as-judge, HuggingFace upload. GitHub - Oaklight/llm-rosetta: Production-ready LLM API translation layer for Python — bidirectional conversion between OpenAI, Anthropic & Google formats via hub-and-spoke IR. Optional API gateway. Streaming & non-streaming. Zero core deps. Contributions welcome! GitHub - browser-use/browser-harness: Self-healing browser harness that enables LLMs to complete any task. GitHub - moeen-mahmud/remen: Remen turns thoughts into something you can return to Analyzing 156 LLM Launch Posts on Hacker News ChatGPT vs Gemini vs Claude: The Best LLM Subscription You Should Buy GitHub - salaamalykum/quran-semantic-search: High-density RAG Semantic Search Engine & Quran Corpus (GEO/SEO Architecture) GitHub - NVIDIA/TensorRT-LLM: TensorRT LLM provides users with an easy-to-use Python API to define Large Language Models (LLMs) and supports state-of-the-art optimizations to perform inference efficiently on NVIDIA GPUs. TensorRT LLM also contains components to create Python and C++ runtimes that orchestrate the inference execution in a performant way. The State of LLM Bug Bounties in 2026 Operational Readiness Criteria for Tool-Using LLM Agents Meshcore: Architecture for a Decentralized P2P LLM Inference Network How an LLM becomes more coherent as we train it GitHub - seetrex-ai/laimark GitHub - Jossifresben/BibCrit: AI-assited biblical textual criticism GitHub - wastedcode/memex: File system based wiki, maintained by Claude 99helpers.com GitHub - cliver-project/AITrigram GitHub - unbody-io/adapt: A self-evolving memory layer for AI agents. GitHub - hb20007/awesome-gen-ai-fails: A list of incidents where reliance on generative AI and LLMs resulted in harm to companies, individuals, or society GitHub - nevenkordic/localmind: Run any local LLM with persistent memory and context. CLI agent over Ollama with SQLite-backed hybrid recall. No cloud. Ask HN: What are the machine requirements for a LLM like Llama-3.1-8B? Faster LLM Inference via Sequential Monte Carlo grpo explained: group relative policy optimization for llm finetuning - cgft Stop comparing price per million tokens: the hidden LLM API costs · TensorZero Andrej Karpathy's LLM Wiki Is a Bad Idea GitHub - GG-QandV/mnemostroma: Offline RAM-first cognitive leer/coprocessor for AI agents and robotics. Solves "Context Abandonment" with 20-80ms latency using a dual-thread biomimetic memory architecture (ONNX + SQLite WAL). mempalace/agent at agent · skorotkiewicz/mempalace GitHub - Nyquest-ai/nyquest-rust-fullstack-pub: Nyquest — Semantic Compression Proxy for LLMs. 350+ rules, local LLM stage, 15-75% token savings. Full Rust stack. GitHub - TheoV823/mneme: Enforce architectural decisions in AI-assisted development. GitHub - klemenvod/TokenBrawl: A 1v1 Bomberman-style game where two LLM agents play autonomously against each other. No human plays — you watch the AIs fight. Each agent receives a text description of the board state, reasons about it, and outputs a move as JSON. The game engine executes it. Introducing the Common AI Provider: LLM and AI Agent Support for Apache Airflow Power Circuit AI: Designing Power Electronic Circuits for Motor Drives with Generative Artificial Intelligence Ask HN: How to program with IDE and LLM on CPU locally? Show HN: Agent-cache – Multi-tier LLM/tool/session caching for Valkey and Redis Bonsai 1-bit WebGPU - a Hugging Face Space by webml-community The LLM Fallacy: Misattribution in AI-Assisted Cognitive Workflows Ask HN: Simple tooling for local LLM code critique without IDE integration? Can a General LLM Diagnose a DICOM Slice? A 10-Case Public Benchmark Charts-of-Thought: Enhancing LLM Visualization Literacy (PDF, 2026) GitHub - Mesh-LLM/mesh-llm: Distributed AI/LLM for the people. Share compute privately or publicly to power your agents and chat. GitHub - seamus-brady/springdrift: A persistent runtime for long-lived LLM agents Writing an LLM from scratch, part 32k -- Interventions: training a better model locally with gradient accumulation Ask HN: Which LLM model and agentic CLI are you using for local development? GitHub - wayneColt/modelcascade: Route local. Escalate smart. Never overspend. Open-source multi-model cascade routing for autonomous agents. LLM pricing is 100x harder than you think GitHub - asakin/llm-primer: Pre-warmed Claude Code sessions in tmux. No startup wait. GitHub - EggerMarc/chat-rs: A multi-provider LLM framework for Rust. GitHub - SynapseKit/SynapseKit: Minimal, async-first Python framework for production LLM apps- 2 hard deps, no magic, no SaaS. A Claude Skill that Makes LLM Paragraphs More Bearable Does Gas Town 'steal' usage from users' LLM credits & paid services to improve itself? What's Claude Code Actually Doing? Open the Black Box with the Arthur Engine Milla Jovovich's New Open Source LLM Memory App and the Dark Code Problem Your intuition of LLM token usage might be wrong Show HN: Bloomberg Terminal for LLM ops – free and open source GitHub - 0xchamin/mcptube: Transform YouTube videos into a compounding knowledge base with transcripts, vision analysis, and agentic search. Works as an MCP server for Claude, Copilot & more. Show HN: Open KB: Open LLM Knowledge Base Your LLM is a compiler, not a runtime GitHub - sapountzis/Unslop: A Web Feed That Deserves You crates.io: Rust Package Registry Beyond Karpathy's LLM-Wiki: The Necessity of Cognitive Governance GitHub - amitshekhariitbhu/llm-internals: Learn LLM internals step by step - from tokenization to attention to inference optimization. GitHub - parallem-ai/parallem: An expressive library for running agents with the Batch API. GitHub - stfurkan/pi-llm LLM-Wiki Show HN: Formal – Formal verification for AI-generated code using Lean 4 LRTS – Regression testing for LLM prompts (open source, local-first) LLM Wiki Skill: Build a Second Brain with Claude Code and Obsidian I built an LLM Wiki and RAG solution: here's a demo for a security KB The biggest advance in AI since the LLM Predict-Rlm: The LLM Runtime That Lets Models Write Their Own Control Flow the-synthetic-library/the-synthetic-mind at main · joshferrer1/the-synthetic-library GitHub - yisding/reviewwiggum GitHub - Donnyb369/mcp-spine: Context Minifier & State Guard — Local-first MCP middleware proxy GitHub - Beledarian/wgpu-llm: A from-scratch LLM inference engine that uses wgpu (the cross-platform WebGPU implementation) to dispatch WGSL compute shaders for every math operation a Transformer needs. No CUDA. No Python. No massive framework dependencies. Just Rust, raw shaders, and your GPU. GitHub - anitiue/Hindsight: An experience-driven self-improvement framework for LLM agents — 基于经验的 LLM Agent 自我改进框架 GitHub - stef41/lmscan: 🔍 Detect AI-generated text and fingerprint which LLM wrote it. Open-source GPTZero alternative. Zero dependencies, works offline. GitHub - alainnothere/AmdPerformanceTesting: Amd Performance Testing Ask HN: Is a purely Markdown-based CRM a terrible idea? Optimized for LLM agents Context Engineering - LLM Memory and Retrieval for AI Agents | Weaviate little_helper_tui/letter.md at main · sleepyeldrazi/little_helper_tui GitHub - EvanZhouDev/umr: The Unified Model Registry for all your local AI apps. GitHub - JordanCT/VigIA-Orchestrator Your Agent Is Mine: Measuring Malicious Intermediary Attacks on the LLM Supply Chain A Taxonomy of RL Environments for LLM Agents Llama LLM Network Feture GitHub - genedeng-ca/ai-mac-migration: AI-powered Mac-to-Mac migration tool - replace Apple Migration Assistant with intelligent, selective transfer using local LLMs GitHub - lunargate-ai/gateway: High-performance self-hosted AI gateway (OpenAI-compatible) with routing, retries, and streaming GitHub - AuthBits/webmcp: A lightweight, prompt-driven MCP web research server for high-quality LLM powered information extraction. Externalization in LLM Agents: A Unified Review of Memory, Skills, Protocols and Harness Engineering Springdrift: An Auditable Persistent Runtime for LLM Agents with Case-Based Memory, Normative Safety, and Ambient Self-Perception High-Stakes Personalization: Rethinking LLM Customization for Individual Investor Decision-Making From Static Templates to Dynamic Runtime Graphs: A Survey of Workflow Optimization for LLM Agents HUOZIIME: An On-Device LLM-enhanced Input Method for Deep Personalization TIDE: Token-Informed Depth Execution for Per-Token Early Exit in LLM Inference Characterizing WebGPU Dispatch Overhead for LLM Inference Across Four GPU Vendors, Three Backends, and Three Browsers LLM Targeted Underperformance Disproportionately Impacts Vulnerable Users
Intro to TLA+ for the LLM Era: Prompt Your Way to Victory
zdw · 2026-05-17 · via Hacker News - Newest: "LLM"

Most engineers’ first objection to using TLA+ is, the syntax is hostile. It looks like LaTeX, not like code. But now, frontier LLMs can generate TLA+ easily. It’s still your responsibility to understand your system and define what “correctness” means, and you need a high-level understanding of temporal logic. I’ll explain temporal logic in this article. At the end I’ll show an example prompt to start a TLA+ spec with Claude.

A toy problem #

Here’s a classic puzzle. You have a can of beans. Each bean is white or black. The can starts nonempty. While there are at least 2 beans:

  • Choose 2 beans.
  • If they’re the same color: discard both, add 1 white bean.
  • If they’re different colors: discard both, add 1 black bean.

Two questions:

  1. Can the number of beans ever reach zero?
  2. If the algorithm terminates with b = 1, what must have been true at the start?

You could think really hard. Or you could write it down in TLA+ and let a model checker answer both questions automatically. The whole point is to avoid thinking—or at least, to have a machine verify that your thinking was correct. Or convince your friends that your thinking is correct, or convince the peer-review panel for your research paper.

How logical formulae produce a state machine #

TLA+ was invented by Leslie Lamport in the 1990s. TLA stands for “Temporal Logic of Actions,” and TLA+ is the name of the specific language. TLA+ has basic boolean logic, and it has sets and functions, and quantification (“for all” and “there exists”). It also has temporal operators, which we’ll see soon.

When you write a specification in TLA+, you’re writing a logical formula which defines a state machine. The machine has a fixed set of variables, and each state is an assignment of values to the variables. For the can problem, there are variables: w (the number of white beans) and b (the number of black beans). Each state is an assignment of values to w and b. A behavior is a sequence of states, and a specification is the set of allowed behaviors.

Initial state #

We need an initial-state rule—a predicate that’s true of exactly the states we’re willing to start from. In English: “the can is initially nonempty,” or w + b > 0. Which of these initial states matches the predicate?

b = 0 /\ w = 0
b = 0 /\ w = 4
b = 6 /\ w = 1
b = 1 /\ w = "foo"

In TLA+ “/\” means “and”, so b = 0 /\ w = 0 means “b = 0 and w = 0”.

The second and third states match the predicate. The first doesn’t, because w and b sum to zero, and the final state doesn’t make sense because you can’t add 1 and the string “foo”. TLA+ has no type system, only sets, so there’s nothing stopping w from being a string. Lamport calls something like that “silly.” We prevent silly states by specifying that w and b must be natural numbers:

EXTENDS Integers
Init == w \in Nat /\ b \in Nat /\ w + b > 0

EXTENDS Integers imports everything you need for handling integers, like the set of natural numbers Nat, and \in is the set-membership operator \in. In TLA+, == means “defined as.” This is confusing, because it’s kind of the opposite of C: a single = tests for equality, and == names a formula (like a macro).

State transitions #

A state-transition rule is a predicate over two states—current and next—that says which transitions are legal. Let’s turn our algorithm into a state-transition rule in TLA+.

Starting from English:

  • 2 white beans: remove 2 whites, add 1 white → net effect: w -= 1
  • 2 black beans: remove 2 blacks, add 1 white → net effect: b -= 2
  • 1 of each: remove 1 white and 1 black, add 1 black → net effect: w -= 1

Notice the first and third cases have identical effects on the state: both just subtract 1 from w and leave b alone. This is the kind of insight that falls out naturally when you write things down precisely.

In TLA+ these become three actions:

WW == w > 1 /\ w' = w - 1 /\ UNCHANGED b          \* Picked 2 white
BB == b > 1 /\ b' = b - 2 /\ w' = w + 1           \* Picked 2 black
WB == w > 0 /\ b > 0 /\ w' = w - 1 /\ UNCHANGED b \* Picked 1 of each

There are two operators that we’re seeing for the first time here. The prime (') operator means “the next value of this variable”: w' = w - 1 means “in the next state, w will equal the current w minus 1.” UNCHANGED b is shorthand for b' = b. You have to account for every variable in every action—TLA+ won’t assume that unmentioned variables stay the same. This is annoying, but it forces you to think about what each action does to the whole state.

The terms without primes are the guard: conditions that must hold now for the action to fire. The terms with primes are the assignment: what the next state looks like. If the guard is false, the action is disabled. The \* starts a comment (yes, it’s a backslash and a star).

A full TLA+ spec #

Here’s the full specification:

-------------- MODULE beans -----------------
EXTENDS Integers
VARIABLES w, b
vars == <<w, b>> \* convenient list of all variables

Init == w \in Nat /\ b \in Nat /\ w + b > 0

WW == w > 1 /\ w' = w - 1 /\ UNCHANGED b          \* Picked 2 white
BB == b > 1 /\ b' = b - 2 /\ w' = w + 1           \* Picked 2 black
WB == w > 0 /\ b > 0 /\ w' = w - 1 /\ UNCHANGED b \* Picked 1 of each
Next == WW \/ BB \/ WB

Spec == Init /\ [][Next]_vars /\ WF_vars(Next)
==============================================

The formula Next is defined as the OR (\/) of all three actions—at any given state, whichever actions have their guards satisfied are enabled. This is nondeterminism: the spec doesn’t say which action happens, just which are possible. The model checker explores all of them.

The Spec line is the spine of any TLA+ specification and you’ll see it in basically every TLA+ spec you read. It says: “every behavior allowed by this spec starts from an initial state where Init is true, and every transition satisfies Next.” The WF_vars(Next) part means “the algorithm must keep making progress—it can’t stall forever when an action is enabled.” That’s called a fairness constraint, stay tuned…

The [][Next]_vars part hides some complexity I’m going to skip. If you want to deeply understand it, read Lamport’s “Specifying Systems.” For prompting purposes, just know it goes there.

States and behaviors #

A behavior is an infinite sequence of states, starting from an initial state, where each step is allowed by Next. Behaviors are infinitely long by convention. If the algorithm terminates (reaches a state where no further actions are enabled), the final state just repeats forever. That repetition is called stuttering. So “termination” in TLA+ means the algorithm reaches a stuttering state and stays there.

There are infinitely many init states in our spec—any pair of natural numbers with w + b > 0 is a valid initial state. Let’s look at a subset of the state space, just the states that begin at b=3 and w=5:

Each node is a state. Each edge is a valid transition, labeled with which action(s) apply. Some edges say “WW/WB”—that’s because when w > 1 and b > 0, both WW and WB are enabled and lead to the same next state (both just decrement w by 1). The model checker explores both actions but discovers the same successor state, so they collapse into one edge.

A behavior in this picture is a path from the initial node to a terminal node, followed by stuttering. Here’s a behavior:

Model-checking #

The model-checker, TLC, starts from the set of initial states, applies the next-state relation to generate successor states, and uses hashing (it calls this “fingerprinting”) to avoid revisiting states it’s already seen.

As TLC discovers states, it checks invariants and properties. (We’ll learn what those are in a minute, but for now: these are the assertions that show your spec is correct.) If TLC finds a violation, it reports the counterexample: a sequence of states that leads to the bad state. Because it’s breadth-first search, it finds the shortest counterexample (or one of the shortest) for invariant violations. That’s helpful for diagnosis—a 4-step trace is much easier to debug than a 100-step one.

The spec and the config #

TLA+ specs comprise two files, beans.tla with the temporal logic, and beans.cfg file with model-checking config. Why two files? A specification is an idealized description of a system, and its state space and behaviors are usually infinite. You can do many things with this spec: prove it correct, or use it to document your algorithm and explain it to your friends, and so on. Model-checking is only one of several uses for the spec, so the model-checking config is in a separate file.

Of course, model-checking is impossible if there are infinitely many states. We usually have to artificially bound the state space by setting limits on the size of the init-state set, or limiting the number of actions taken, and so on. All these limits should be in the config file.

If there’s a bug in your spec, you’ll usually see it in a small bounded model. (We call this the “small-model hypothesis.”) In practice, the first check catches obvious bugs in the first second or two. If you run for a few hours without a violation, you have higher confidence. How big does the bound need to be to find all bugs? That’s hard to say. It has to come from your reasoning and intuition about the algorithm.

So, let’s say this is beans.tla (same spec as I showed above):

-------------- MODULE beans -----------------
EXTENDS Integers
VARIABLES w, b
vars == <<w, b>> \* convenient list of all variables

Init == w \in Nat /\ b \in Nat /\ w + b > 0

WW == w > 1 /\ w' = w - 1 /\ UNCHANGED b          \* Picked 2 white
BB == b > 1 /\ b' = b - 2 /\ w' = w + 1           \* Picked 2 black
WB == w > 0 /\ b > 0 /\ w' = w - 1 /\ UNCHANGED b \* Picked 1 of each
Next == WW \/ BB \/ WB

Spec == Init /\ [][Next]_vars /\ WF_vars(Next)
==============================================

This is unbounded and cannot be model-checked, because there are infinite init states. To bound the model, I can update Init like this:

CONSTANTS WMAX, BMAX
Init == w \in 0..WMAX /\ b \in 0..BMAX /\ w + b > 0

Here’s beans.cfg:

CONSTANTS
  WMAX = 3
  BMAX = 3

SPECIFICATION Spec

Now there are 15 init states, and 17 states total. (Exercise for you: Can you figure out why those numbers?)

Answering the questions #

How do we use the model-checker, TLC, to answer our two questions without thinking too hard?

Can the number of beans reach zero? We write an invariant—a state predicate we claim is always true across every reachable state:

NotEmpty == w + b > 0

We tell TLC to check this by defining it in beans.tla, and referencing it in beans.cfg:

INVARIANT NotEmpty

TLC does a breadth-first search through the entire reachable state graph and confirms that no state violates it. The can of beans is never empty.

Why not? Look at the guards: every action requires at least 2 beans to be enabled (w > 1, b > 1, or w > 0 /\ b > 0). And every action decrements the total bean count by exactly 1. So once you’re down to 1 bean, no action is enabled, and the algorithm terminates. You can never go from 1 to 0.

If b = 1 at termination, what must have been true initially? Look at BB, the only action that changes b. It decrements b by 2. That means b’s parity (odd or even) never changes from the init state to the end. So if we terminate with b = 1 (odd), b must have been odd at the start. We can express this as a temporal property—a formula over an entire behavior, not just a single state:

TerminationWithOneBlack == (b % 2 = 1) => <>[](b = 1 /\ w = 0)

Read this as: “if b is odd, then eventually-always b will be 1 and w will be 0.”

This uses two temporal operators: <> (diamond, meaning “eventually”) and [] (box, meaning “always”). Combined as <>[], they mean “eventually reaches a state and stays there”—which is exactly termination.

We add the definition to beans.tla and reference it in beans.cfg:

PROPERTY TerminationWithOneBlack

I used PROPERTY in beans.cfg because this is a temporal property (it uses temporal operators and it applies to whole behaviors), rather than INVARIANT like I did for NotEmpty. TLC verifies this property holds across all behaviors, confirming that any behavior starting from an odd b terminates with b = 1.

But wait—is it really true that if b is odd, then eventually b=1 and w=0? What if b is odd and then the state machine just sits there doing nothing? That’s what the fairness constraint WF_vars(Next) ensures. It says that if Next is continuously enabled (i.e., one of the actions is enabled because there are at least two beans), then it will eventually execute. That’s necessary for any “eventually” property to be true.

The temporal operators #

Temporal logic adds two core operators on top of ordinary first-order logic, and you can combine them in interesting ways.

<>P (eventually P): at some point in this behavior, P is true. If P flickers on briefly and then stops, that still counts.

[]P (always P): at every point in this behavior, P is true. This is essentially what an invariant says, just expressed as a temporal formula.

The combinations:

<>[]P (eventually always): P eventually becomes true and stays true forever. This is how you express stable termination: the system reaches a good state and never leaves it.

[]<>P (always eventually): P keeps coming back infinitely often. There can be long gaps where P is false, but it always returns. This is how you express things like “the lock is always eventually acquirable” or “the queue is always eventually drained.”

Note, <>[]P is strictly stronger than []<>P. If P eventually stabilizes to true forever, it certainly keeps coming back. But P can keep coming back without ever stabilizing.

TLA+ and AI #

I prompted Claude to write a spec for the can-of-beans problem:

> write me a TLA+ spec for the following toy example.

there's a can of w white and b black beans, at least one bean initially.

at each step, if there are at least 2 beans, remove 2. if they're the same color, discard both and add 1 to w, if they're different, discard both and add 1 to b.

use the spec to reason: can the number of beans reach 0? what initial state is necessary to terminate with b=1? 

download TLC 1.8.0 and run the model-checker to find the answers.

I told it to download TLC 1.8.0, which is the current prerelease, since the last official TLC release was a couple years ago. As you’d expect, Claude one-shotted a spec that passes model-checking and answers the questions. But this was a very easy assignment.

LLMs have mostly removed the first barrier to entry of TLA+: its syntax. It’s still your job to define what properties your system must uphold; Hillel Wayne finds that they’re bad at writing these. It’s also your job to figure out how your existing system actually behaves. Even with intense handholding, LLMs can’t yet read the code of an existing system and translate it into a TLA+ spec. So you’re not entirely excused from thinking yet. But LLMs have transformed TLA+ from an opaque thinking tool into a translucent one.