网页
综合
更新时间 2026-10-27 04:24:51
seance: an offline seance with the ghost of ALGOL 60 - DEV Community
自动蜘蛛
dev.to
正文约 3108 字
Posted on Oct 27 • Edited on Oct 27 • AI-assisted
the week 4 prompt said "ghost in the machine" and the challenge page itself suggested an offline seance chatbot that channels a long-dead programming language. i liked that idea enough to build it: a seance with the ghost of ALGOL 60, the language that gave us block structure, BNF, and call-by-name, summoned on a 2-core CPU box with no internet.
you ask a question. the ghost answers in first person, briefly, a little eerie - but only from a small curated record of 32 source-checked ALGOL 60 memories. ask about its birth in Paris, quicksort, or why it could never print anything, and it answers with citations. ask about the weather, or python, or COBOL, and the candles gutter: an honest in-character refusal.
a 1B model hallucinates. mine invented a mainframe at the university of california, berkeley, in 1968 (struck through in the demo, you can watch the guard catch it). it invented 1966 twice. the guard caught all of these, because "berkeley" and "1966" are not written in the record.
but the guard checks tokens, not meaning. in one recorded run, asked what tony hoare said about ALGOL, the ghost called itself "a language born in 1973" - and the guard passed it, because 1973 is in the record (it is the year of hoare's verdict). a true token in a false claim. i left that run in the demo on purpose: it is the honest limit of this approach, at least at this size. whether a bigger model would slip less, this project cannot tell you - it can only show where the token check stops.
everything in this project is inspectable because the model is open-weight. gemma's weights sit on disk; the whole seance runs with the network cable pulled. the runs behind this post happened on a 2-core cloud CPU, no GPU. i can pin the exact artifact (gemma-3-1b-it, Q4_K_M), show you the exact prompt, replay the exact runs, and you can check my claims against the record, the tests, and the transcripts. none of that is possible when the ghost lives behind an API. open weights are what let a toy project be honest about what the model did - including where it lied.
25-question eval, real inference, temp 0.2:
built in the week 4 window, free only: gemma-3-1b-it (Gemma Terms of Use), llama.cpp (MIT), python stdlib.
AI disclosure: this project uses an open-weight AI model (gemma-3-1b-it) as the core of the artifact, as described above - it generates the ghost's voice from a curated record, and a deterministic guard constrains it. this post was drafted with AI assistance, and the project itself - code, record, tests, demo page - was built by my AI assistant on my behalf, on a cloud CPU. i set the direction, and the decision to publish is mine. all eval numbers come from real recorded runs, with raw outputs in the repo.
DEV Community — A space to discuss and keep up software development and manage your software career
Built on Forem — the open source software that powers DEV and other inclusive communities.
Made with love and Ruby on Rails. DEV Community © 2016 - 2026.
We're a place where coders share, stay up-to-date and grow their careers.
本页为82搜索生成的网页快照,内容来自站内索引;演示数据的原文链接仅作示例。