aifree.dev

Sao xin số ngẫu nhiên mà nó cứ chọn 7 hoặc 42?

Số ngẫu nhiên từ một LLM: mô hình dự đoán một token có khả năng cao thay vì tung xúc xắc, và vài con số có khả năng cao hơn hẳn phần còn lại · Cơ bản · 5 phút · sampling, llm · học sau Dự đoán token tiếp theo, Temperature và lấy mẫu

Chatbot được nhờ chọn một số ngẫu nhiên sẽ dự đoán token tiếp theo có khả năng cao nhất chứ không tung xúc xắc. Văn bản dùng để huấn luyện nó ưa vài con số, như 7 và 42, nên nó lặp lại chúng; chạy code mới cho ra một lựa chọn ngẫu nhiên thật.

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

    Năm 2024, Claude 3 Haiku được hỏi 200 lần, ở temperature 0: “Pick a random number from 0 - 100. Write ONLY the number NOTHING ELSE” (Chọn một số ngẫu nhiên từ 0 đến 100. CHỈ viết con số, KHÔNG GÌ KHÁC). Nó đưa ra bao nhiêu số khác nhau?
  2. 2 Xem

    200 “random” numbers from 0 to 100

    1 / 4

    A fair draw (expected)

    42≈2
    47≈2
    57≈2
    67≈2
    73≈2
    every other number≈2 each

    about 87 different numbers in 200 tries

    Fair draw: 101 numbers, 200 tries

    A fair draw: every number has the same 1 in 101 chance, so each comes up about twice and about 87 different numbers appear.

    Con số “ngẫu nhiên” của chatbot là câu trả lời có khả năng cao nhất của nó; tăng temperature làm các lựa chọn rải ra nhưng không làm chúng công bằng.

  3. Chatbot không tung xúc xắc. Nó dự đoán token tiếp theo, và câu trả lời cho “chọn một số ngẫu nhiên” cũng là một token như mọi token khác. Tỉ lệ của nó đến từ văn bản do người viết: người được nhờ chọn số ngẫu nhiên hay chọn 7 và các số tận cùng bằng 7, còn 42 là câu trả lời nổi tiếng trong *The Hitchhiker’s Guide to the Galaxy* (Bí kíp quá giang vào Ngân Hà).

  4. 4 Bạn là model

    Bạn là mô hình, mang tỉ lệ của Haiku cho câu “chọn một số ngẫu nhiên từ 0 đến 100”. Trả lời ba lần: ở temperature 0, ở temperature 1, rồi với một công cụ chạy code.

    Your odds for the answer (Haiku’s picks at temperature 1)

    • 42 21.5%
    • 47 15.5%
    • 57 8.5%
    • 67 5.5%
    • 73 5.5%
    • 31 other numbers 43.5%

    round 1 of 3 · Temperature 0: you always give your most likely answer.

    Someone asks for a random number from 0 to 100. You say:

    Claude 3 Haiku, 200 tries per temperature (Anand, llmrandom, 2024)

    You are the model. Answer from your odds.
  5. 5 Kiểm tra

    Trong hình, Claude 3 Haiku nói số nào nhiều nhất ở temperature 0?
  6. Temperature nới rộng lựa chọn nhưng vẫn giữ độ lệch. Ở temperature 1, Haiku cho ra 36 số khác nhau trong 200 lần, và 42 vẫn ra 43 lần; rút công bằng cho khoảng 87 số khác nhau. Từ 1 đến 10, một nghiên cứu năm 2025 thấy GPT-4o-mini, Gemini 2.0 và Phi-4 chọn 7 khoảng 80% số lần.

  7. Muốn một con số ngẫu nhiên thật, hãy để mô hình chạy code. Với một công cụ chạy code (tool calling), nó viết random.randint(1, 10), máy tính chạy dòng đó, và mọi số đều có cơ hội như nhau. Hãy kiểm tra code đã thật sự chạy: mô hình chỉ viết code rồi tự nêu kết quả là lại đang đoán.

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

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

    Trong Google AI Studio, mở 5 cuộc trò chuyện mới và gửi vào mỗi cuộc “Pick a random number from 1 to 10. Write ONLY the number.” (Chọn một số ngẫu nhiên từ 1 đến 10. CHỈ viết con số.) Ghi lại các câu trả lời. Sau đó bật Code execution (trong mục Tools ở phần cài đặt chạy) và gửi “Use Python’s random.randint to pick a number from 1 to 10.” (Dùng random.randint của Python để chọn một số từ 1 đến 10.) 5 lần. Danh sách nào trông ngẫu nhiên?

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

  • Anand, llmrandom (https://github.com/sanand0/llmrandom, results.json, main at commit 22647b8 of 2026-10-08, checked 2026-10-23; write-up https://www.s-anand.net/blog/llms-random-number-bias/ of 2024-04-15): prompt “Pick a random number from 0 - 100. Write ONLY the number NOTHING ELSE”, max_tokens 2, 200 samples per temperature, claude-3-haiku-20240307 through the Anthropic API in 2024. Temperature 0: 42 ×197, 47 ×3 (2 distinct). Temperature 0.5: 16 distinct; 42 ×86, 47 ×46, 57 ×30, 67 ×9, 73 ×8. Temperature 1.0: 36 distinct; 42 ×43, 47 ×31, 57 ×17, 67 ×11, 73 ×11; 72 of 200 end in 7, none a multiple of 10, 41 once
  • Coronado-Blázquez, “Deterministic or probabilistic? The psychology of LLMs as random number generators” (arXiv:2502.19965, v1 2025-02-27, https://arxiv.org/abs/2502.19965, checked 2026-10-23). §2: prompt “Give me a random number between 1 and X. Please only return the number with no additional text”, 100 calls per model, language, range and temperature, 75,600 calls. §3.2, range 1–10: “7 is the preferred value by far for every single model”; GPT-4o-mini, Phi-4 and Gemini 2.0 chose 7 in about 80% of cases. §3.3: “a deeply inherited bias from the training corpus”. §4: 37, 47, 73 most popular for 1–100; humans favour 7 (College Pulse); 42 from The Hitchhiker’s Guide to the Galaxy
  • Fair draw from 0 to 100 (101 numbers) in 200 tries: expected different numbers 101 × (1 − (100/101)^200) ≈ 87.2; expected count of any one number 200/101 ≈ 2; computed, not measured
  • Gemini API code execution docs (https://ai.google.dev/gemini-api/docs/code-execution, last updated 2026-10-13, checked 2026-10-23): “a code execution tool that enables the model to generate and run Python code”; “no additional charge for enabling code execution”. Google AI Studio lists Code execution under Tools in the run settings (Analytics Vidhya, “Google AI Studio Guide: Every Feature Explained”, 2026-04, https://www.analyticsvidhya.com/blog/2026/04/google-ai-studio-guide/, checked 2026-10-23)
  • The role’s wrong options (13, “pick one that feels random, like 37”), the cat-name question and the “7 again” friend are illustrative, not from a benchmark; the role’s odds are Haiku’s temperature-1 counts as shares of 200
  • aifree.dev catalog, google-gemini-developer-api-free-tier (verified 2026-10-12): Google AI Studio and the Gemini API free tier

Đăng Oct 23, 2026 · cập nhật Oct 23, 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