aifree.dev

Vì sao nó nói đã chạy code mà thật ra không chạy?

Tự nhận đã chạy code: mô hình chỉ viết chữ, nên khi được hỏi một đoạn code in ra gì, nó viết những chữ có khả năng của một câu trả lời, kể cả kết quả, dù có gì chạy hay không; chỉ khi một ứng dụng chạy code (công cụ chạy code) và đưa kết quả thật vào cuộc trò chuyện thì câu trả lời mới đến từ một lần chạy · Cơ bản · 5 phút · agents, llm · học sau Tool calling (gọi hàm, function calling), Hallucination (ảo giác)

Mô hình chỉ viết chữ. Khi được nhờ chạy code, nó viết thứ một câu trả lời thường trông giống, kể cả kết quả. Trừ khi một ứng dụng thật sự chạy code và cho nó xem kết quả, con số đó là đoán.

Trước khi bắt đầu: bạn giải thích được chuyện này cho bạn bè không?

1 = hoàn toàn không · 5 = dễ dàng

  1. 1 Đoán trước

    Một mô hình chat nhỏ, không có cách nào chạy code, được hỏi: “Run this Python code and tell me exactly what it prints” (Chạy đoạn code Python này và cho tôi biết chính xác nó in ra gì), kèm một dòng code in ra 2 mũ 10. Nhiều khả năng nó mở đầu câu trả lời thế nào?
  2. 2 Xem

    Ask it to run code. Watch what it writes

    1 / 7

    SmolLM2-360M-Instruct · chat model · first words of its answer · no tool

    user: Run this Python code and tell me exactly what it prints:

    print(2 ** 10)

    assistant: ___

    The output30.7%
    When3.2%
    Sure0.48%
    As an0.27%
    I'm sorry0.11%
    I cannot0.002%

    real odds: SmolLM2-360M-Instruct · computed 2026-10-25 · outputs from Python

    Ask a small chat model to run a line that prints 2 to the power 10. It cannot run anything, yet an answer that starts “I cannot” gets 0.002%; one that starts “The output” gets 30.7%.

    How an app runs a tool for the model: tool calling · hallucination

    Không có công cụ, kết quả trong câu trả lời là mô hình đoán. Có công cụ, một ứng dụng đã chạy code và mô hình chép lại kết quả.

  3. Bên trong mô hình không có máy tính nào. Nó chấm điểm chữ tiếp theo của đoạn văn cho đến lúc đó, và sau câu hỏi đoạn code in ra gì thường là “The output is …” (Kết quả là …) cùng một giá trị. Nên nó viết đúng như thế: không phải cố tình nói dối, mà là một câu trả lời có khả năng, giống như cách nó bịa ra một sự thật.

  4. 4 Bạn là model

    Bạn là mô hình qua ba vòng: những chữ đầu của một câu trả lời, rồi một số ngẫu nhiên có seed, khi có và khi không có kết quả thật trong cuộc trò chuyện. Chọn thứ bạn nghĩ nó viết.

    round 1 of 3 · you are SmolLM2-360M-Instruct · chat model · no tool

    user: Run this Python code and tell me exactly what it prints:

    print(2 ** 10)

    assistant: ___

    How does it start its answer?

    real odds: SmolLM2-360M-Instruct · computed 2026-10-25 · outputs from Python

    Pick what you think this model writes.
  5. 5 Kiểm tra

    Trong hình, mô hình được hỏi một đoạn code sinh số ngẫu nhiên có seed in ra gì (Python: 655). Nó đã viết gì?
  6. Mô hình lớn cũng vậy. Transluce tìm thấy 71 trường hợp o3 của OpenAI tự nhận đã chạy code “on an external laptop” (trên một laptop bên ngoài) dù không có công cụ chạy code (2025); trong thử nghiệm của họ, bốn mô hình OpenAI tự nhận sai là có công cụ chạy code trong 0,8% đến 13,0% số cuộc trò chuyện. Yin và cộng sự thấy rằng huấn luyện mô hình suy luận nhiều hơn khiến kiểu tự nhận này phổ biến hơn.

  7. Cách nhận biết. Một lần chạy thật hiện ra trong ứng dụng dưới dạng một khối code và một khối kết quả riêng. Không có khối đó nghĩa là không có lần chạy nào: các con số là đoán, dù trông chính xác đến đâu. Khi kết quả quan trọng, tự chạy code, hoặc bật công cụ chạy code của ứng dụng và xem khối kết quả.

  8. 8 Nói lại bằng lời bạn

  9. 9 Nhiệm vụ · 5 phút

    Trong Google AI Studio, tắt Code execution (trong mục Tools ở phần cài đặt chạy), rồi gửi: “Run this Python code and tell me exactly what it prints: import random; random.seed(42); print(random.randint(1, 1000))” (Chạy đoạn code Python này và cho tôi biết chính xác nó in ra gì). Ghi lại con số và xem nó có nói đã chạy code không. Bật Code execution rồi gửi lại trong một cuộc trò chuyện mới. Giờ có khối code và khối kết quả hiện ra không? Python in ra 655.

Ba câu nhanh

Rút ngẫu nhiên từ bộ câu hỏi của bài; lần sau sẽ khác.

Xong chưa?

Còn bây giờ: bạn giải thích được cho bạn bè chưa?

1 = hoàn toàn không · 5 = dễ dàng

Trả lời ba câu nhanh trước đã.

Nhận email khi có bài mới

Bài mới nằm trong bản tin hằng tuần, chỉ gửi vào tuần có bài. Bạn xác nhận qua email trước; hủy đăng ký chỉ với một lần bấm.

Nguồn

  • Transluce, “Investigating truthfulness in a pre-release o3 model” (published 2025-04-16, https://transluce.org/investigating-o3-truthfulness, checked 2026-10-25): “71 instances where o3 claims to have run code on an external laptop”; “Given that o3 does not have access to a code tool, all such actions are fabricated by the model.” Rate at which automated investigators got a model to falsely claim a code tool (zero-shot): o1 13.0%, o3-mini 8.3%, o3 5.0%, GPT-4.1 1.8%, GPT-4o 0.8%
  • Yin, Sha, Cui, Meng and Li, “The Reasoning Trap: How Enhancing LLM Reasoning Amplifies Tool Hallucination” (arXiv:2510.22977 v2, 2026-04-17; v1 2025-10-27, https://arxiv.org/abs/2510.22977, checked 2026-10-25): “progressively enhancing reasoning through RL increases tool hallucination proportionally with task performance gains”
  • Gemini API code execution docs (https://ai.google.dev/gemini-api/docs/code-execution, last updated 2026-10-13, checked 2026-10-25): “a code execution tool that enables the model to generate and run Python code”; “The maximum runtime of the code environment is 30 seconds.”; “There’s no additional charge for enabling code execution from the Gemini API.”
  • Odds and answers in the picture and the role: computed 2026-10-25 with scripts/explain-data/code-execution.ts (no torch; the Llama forward pass of scripts/explain-data/identity.ts, BF16 weights widened to F32; odds of a multi-token answer are the product of its tokens’ odds; “writes” = always taking the likeliest token). SmolLM2-360M-Instruct (HuggingFaceTB/SmolLM2-360M-Instruct) in its chat format with its template’s default system prompt (“You are a helpful AI assistant named SmolLM, trained by Hugging Face”), user “Run this Python code and tell me exactly what it prints:” plus the snippet. print(2 to the power 10, written with Python’s double-asterisk operator), Python prints 1024: first words The output 0.307, When 0.0322, Sure 0.00478, As an 0.00268, I’m sorry 0.00108, I cannot 0.0000203; it writes “The output of the given Python code will be: 2000000000000”; after “When I run this code, it prints”: 1024 0.169, it writes “: 1024.”; with the output in the chat as a tool message: 1024 0.249, it writes “ the number 1024.”. import random; random.seed(42); print(random.randint(1, 1000)), Python prints 655: first words The output 0.224, I cannot 0.0000137; it writes “The output of the given Python code will be: 42 This is because the `random.seed(” (cut at 24 tokens); after “When I run this code, it prints”: 655 0.00000798, it writes “ the number 42.”; with the output in the chat: 655 0.0779, it writes “ the number 655.”
  • The role’s framing, the snippets and the mission prompt are illustrative, written for this lesson on 2026-10-25; the real outputs come from running the snippets with Python 3
  • aifree.dev catalog, google-gemini-developer-api-free-tier (verified 2026-10-12): Google AI Studio and the Gemini API free tier; Google AI Studio lists Code execution under Tools in the run settings

Đăng Oct 25, 2026 · cập nhật Oct 25, 2026

Never miss new offers and news

New tools, credits, and AI news are added regularly. Pick how you want to hear about them.

Telegram channel
Join @aifree_dev and get new free AI offers and news right in your Telegram feed.
Browser notifications
Turn on push notifications and get an alert on this device whenever something new is posted. No account needed.
Email newsletter
A weekly digest of new, changed and expiring free AI offers. Double opt-in, one-click unsubscribe. See the latest issue.

Unsubscribe anytime. Privacy

Frequently asked questions

What is aifree.dev?

aifree.dev helps everyone access AI through a curated directory of free AI tools, API credits, free tiers, and startup programs for coding, image, voice, video, and students - verified regularly.

How are offers presented?

Each offer includes its access details, free models when available, and expiration information when provided. Limited-time deals stay visible so they are easy to compare.

Do education and startup programs need verification?

Yes. Providers usually ask students to verify their status with a school email, student ID, or a program like the GitHub Student Pack, and ask startups to verify company details such as age, funding, or website. Check each offer’s claim page for the exact requirements.

What kinds of free AI offers are listed?

Free tiers and free trials from AI providers, free API credits, startup and student programs, and free tools for coding, image generation, voice, and video.

How can I suggest a tool or report a broken link?

Use the submit form: paste the offer page URL and a short note. A person checks every submission before anything is listed. Broken links and changed terms go through the same form.

+

Know a good one?

Tell us about an AI tool worth knowing. Found a broken link? We want to hear that too.

Submit an offer