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

推荐订阅源

奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园_首页
大猫的无限游戏
大猫的无限游戏
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Apple Machine Learning Research
Apple Machine Learning Research
B
Blog
B
Blog RSS Feed
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
P
Proofpoint News Feed
MyScale Blog
MyScale Blog
Engineering at Meta
Engineering at Meta
量子位
H
Hackread – Cybersecurity News, Data Breaches, AI and More
T
Tailwind CSS Blog
Stack Overflow Blog
Stack Overflow Blog
N
Netflix TechBlog - Medium
T
The Blog of Author Tim Ferriss
U
Unit 42
aimingoo的专栏
aimingoo的专栏
博客园 - 叶小钗
博客园 - 【当耐特】
云风的 BLOG
云风的 BLOG
博客园 - Franky
博客园 - 聂微东

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Calculator Never Guesses. But LLM Always Does.
Raghavendra · 2026-04-26 · via DEV Community

The LLM:Probabilistic Predictor
An LLM (Large Language Model) does not have a math engine. It is a Next-Token Predictor. When you ask it a question, it is performing a high-speed search through a high-dimensional space of text patterns.

The process: It views your query as a sequence of tokens, converts them into vectors, and uses Self-Attention to weigh the importance of those tokens.

The outcome: It is always calculating probability. When it produces 2 as the answer to 1 + 1=, it isn't "adding"; it is identifying the highest-probability next token based on billions of instances of that pattern in its training data.
Probabilistic

The Calculator: Deterministic Engine
A calculator is built using a hardware-level Arithmetic Logic Unit (ALU). It operates on deterministic logic. When you press 1, then +, then 1, the hardware executes a pre-wired sequence of digital logic gates.

The process: It converts these numbers into binary, performs the exact Boolean operation for addition, and outputs the result.

The outcome: It is always exact. It doesn't "know" what 1 is; it simply follows the physical laws of its circuit design. It does not possess, nor does it need, training data.

Why LLMs Struggle with Arithmetic
1. The Tokenization "Blind Spot"
LLMs break text into sub-word units called tokens. For common numbers, this is fine. But for large or unconventional numbers, the model might split them into arbitrary, non-numerical fragments (e.g., 123,456 might become [123, 456]). Because the model sees these as linguistic tokens rather than singular values, it loses the concept of place value. It cannot "carry" a one or manage a decimal point because it doesn't see a number—it sees a string of text.

2. Pattern Matching vs. Algorithmic Reasoning
When an LLM gets a math problem right, it is essentially "recalling" a pattern from its training data. If you ask a common question like 15 * 15, it likely has that specific sequence in its training set and produces the right answer. But if you ask it a rare, large-scale multiplication problem, it has no "ground truth" to rely on. It begins to hallucinate because it is attempting to predict the structure of a mathematical response rather than executing the algorithm of the math itself.

3. The Limits of Self-Attention
Self-attention is an incredible tool for natural language; it helps the model understand that in the sentence "The animal didn't cross the street because it was too tired," the word "it" refers to the animal. However, self-attention is not designed to maintain state in a sequential calculation. Without "Chain of Thought" (asking the model to write out the steps), the model is trying to solve the problem in a single pass—a task for which it has no internal memory or scratchpad.

The "Pro" Takeaway: The Hybrid Future
LLMs are brilliant at intent, context, and reasoning, but they are fundamentally flawed as computation engines.

If you want to build a reliable AI agent, stop asking the LLM to do the math. The industry standard is to treat the LLM as a Coordinator that detects when math is required, extracts the relevant variables, and hands them off to a Deterministic Tool (like a Python script, an API, or a calculator function).

In short: Let the LLM do the thinking, but let your traditional code do the calculating. That is the secret to building AI that doesn't guess.