跳到正文
cccskills
免费在 GitHub 公开

llm-as-computer

Execute programs on a compiled transformer stack machine where every instruction fetch and memory read is a parabolic attention head. Demonstrates that transformer attention + FF layers can implement a working computer. Use when user mentions "llm-as-computer", "lac", "stack machine", "compiled transformer", "percepta", "parabolic attention", "execute program", or asks to run/trace programs on the transformer executor.

中文简介正在准备中。当前显示原文说明。

实测评分 未实测

查看安装方法

包含的文件(7)

  • SKILL.md4.7 KB
  • CHANGELOG.md996 B
  • src/executor.mojo27.8 KB
  • src/isa_lite.py5.6 KB
  • src/programs.py20.6 KB
  • src/runner.py11.8 KB
  • src/setup.sh960 B

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

LLM-as-Computer: Compiled Transformer Stack Machine

A working computer built from transformer primitives. Every instruction fetch and stack read is a parabolic attention head (dot-product → argmax → value extraction). The transformer's weights ARE the interpreter — compiled analytically, not trained.

What This Proves

Attention is lookup; feed-forward is routing. A vanilla transformer with compiled weights can execute arbitrary programs: loops, recursion, arithmetic, memory access. 55 opcodes covering WASM i32 semantics. 21M+ steps/second via the Mojo executor.

Setup (once per session)

cd /mnt/skills/user/llm-as-computer/src && bash setup.sh

This installs Mojo (~20s) and compiles the executor binary (~6s). If Mojo is unavailable, the skill falls back to a pure-Python executor (slower but functional).

Usage

import sys
sys.path.insert(0, '/mnt/skills/user/llm-as-computer/src')

from programs import make_fibonacci, make_factorial, make_gcd, make_multiply
from runner import run, setup

# Ensure Mojo is compiled (idempotent)
setup()

# Run a program — shows instructions, trace, result
prog, expected = make_fibonacci(10)
print(run(prog))

# Benchmark mode — measures throughput
print(run(prog, benchmark=True, repeat=200))

Available Programs

From programs.py — all return (program, expected_result):

GeneratorDescriptionExample
make_fibonacci(n)Iterative fib via SWAP+OVER+ADD+ROTfib(10)=55, 111 steps
make_multiply(a, b)Repeated additionmul(7,8)=56
make_factorial(n)Loop with MULfact(8)=40320
make_gcd(a, b)Euclidean algorithmgcd(48,18)=6
make_power_of_2(n)Repeated doubling2^7=128
make_sum_1_to_n(n)Accumulation loopsum(15)=120
make_is_even(n)Parity checkis_even(7)=0
make_native_multiply(a,b)Single MUL opcode
make_native_divmod(a,b)DIV_S + REM_S
make_compare_binary(op,a,b)eq/ne/lt_s/gt_s/le_s/ge_s
make_bitwise_binary(op,a,b)and/or/xor/shl/shr_u/rotl/rotr
make_select(a,b,c)Conditional select

Writing Custom Programs

from isa_lite import program

# Assembly tuples
prog = program(
    ('PUSH', 10),
    ('PUSH', 20),
    ('ADD',),
    ('DUP',),
    ('ADD',),  # (10+20)*2 = 60
    ('HALT',),
)
print(run(prog))

# Loops: countdown from 5
prog = program(
    ('PUSH', 5),    # 0: counter
    ('PUSH', 1),    # 1: decrement
    ('SUB',),       # 2: counter - 1
    ('DUP',),       # 3: copy for JNZ test
    ('JNZ', 1),     # 4: loop if non-zero
    ('HALT',),      # 5: done, top = 0
)
print(run(prog))

ISA Reference (55 opcodes)

Stack: PUSH n, POP, DUP, SWAP, OVER, ROT Arithmetic: ADD, SUB, MUL, DIV_S, DIV_U, REM_S, REM_U Comparison: EQZ, EQ, NE, LT_S/U, GT_S/U, LE_S/U, GE_S/U Bitwise: AND, OR, XOR, SHL, SHR_S/U, ROTL, ROTR Unary: CLZ, CTZ, POPCNT, ABS, NEG, SELECT Control: JZ addr, JNZ addr, CALL addr, RETURN, HALT, NOP Locals: LOCAL.GET idx, LOCAL.SET idx, LOCAL.TEE idx Memory: I32.LOAD, I32.STORE, I32.LOAD8_U/S, I32.LOAD16_U/S, I32.STORE8, I32.STORE16

All arithmetic is 32-bit signed with WASM i32 semantics (wrap on overflow).

Architecture

The key insight: parabolic encoding k = (2j, -j²) makes dot-product attention peak sharply at a target position. Same encoding addresses program memory, stack, locals, and heap without interference. Each attention head is a compiled W_Q @ state → query, W_K @ memory → keys, scores = K @ q, output = V[argmax(scores)].

Updating from Repo

To pull latest source from the repository:

cd /mnt/skills/user/llm-as-computer/src
GH_TOKEN=$(grep GH_TOKEN /mnt/project/GitHub.env 2>/dev/null | cut -d= -f2)
for f in executor.mojo; do
  curl -sL -H "Authorization: token $GH_TOKEN" -H "Accept: application/vnd.github.v3.raw" \
    "https://api.github.com/repos/oaustegard/llm-as-computer/contents/src/$f?ref=main" > $f
done
for f in isa_lite.py programs.py runner.py; do
  curl -sL -H "Authorization: token $GH_TOKEN" -H "Accept: application/vnd.github.v3.raw" \
    "https://api.github.com/repos/oaustegard/llm-as-computer/contents/skill/src/$f?ref=main" > $f
done
rm -f percepta_exec  # force recompile
bash setup.sh

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

GitHub repository access in containerized environments using REST API and credential detection. Use when git clone fails, or when accessing private repos/writing files via API.

中文简介正在准备中。当前显示原文说明。

oaustegard/claude-skills1542026年10月23日 更新

Decide which model, effort level, and cascade shape each subagent gets, and how to keep improvement loops safe (evaluator-as-selector, stop on regression). Routes on measured cost-per-completed-task rather than per-token price, because a tier's token count varies more by task shape than price varies across tiers. Covers per-model effort semantics, the concision lever, cascade preconditions, context handoff, and watching a subagent fan-out live. Use when choosing a subagent's model or effort, when choosing how to escalate a failed attempt, or when asked which model or effort a task should get. Grounded in a 2026-07 calibration, a 2026-08 coding-cost study, a 2026-09 seeded-bug repair battery, a 2026-10 Haiku 5.5 ladder priced per spawn, and a 2026-10 retry-versus-escalation ladder on 295 SWE-bench Verified tasks; Managed Agents API specifics are operational, not calibrated.

中文简介正在准备中。当前显示原文说明。

oaustegard/claude-skills1542026年10月23日 更新

Securely manages API credentials for multiple providers (Anthropic Claude, Google Gemini, GitHub). Use when skills need to access stored API keys for external service invocations.

中文简介正在准备中。当前显示原文说明。

oaustegard/claude-skills1542026年10月23日 更新

Guidance for asking clarifying questions when user requests are ambiguous, have multiple valid approaches, or require critical decisions. Use when implementation choices exist that could significantly affect outcomes.

中文简介正在准备中。当前显示原文说明。

oaustegard/claude-skills1542026年10月23日 更新

Pre-change blast-radius report for a symbol or file. Walks tree-sitting references, augments with a plain-text scan over non-parsed files (configs, plain docs), and clusters affected sites by feature (`_FEATURES.md`) or top-level package. Use when about to refactor, rename, or delete something in a repo you don't own — "what breaks if I change `validateUser`", "who calls this", "is this safe to remove", "where is this used", "blast radius", "impact analysis". This is the CONVERGENT pre-change risk skill — for "what is this repo?" use exploring-codebases; for "where is X?" use searching-codebases.

中文简介正在准备中。当前显示原文说明。

oaustegard/claude-skills1542026年10月23日 更新

Read Bluesky/ATProto without depending on Bluesky's AppView — interactions on a user's posts, thread replies, any repo's records, network-wide backlinks across every lexicon, an account's handle and PDS history, which collections are active network-wide, and layer-by-layer outage diagnosis. Use when bsky.app or the AppView is down or slow, when a Bluesky read returns timeouts or 5xx, when asked who liked/replied/quoted/reposted something, when pulling live Bluesky context cheaply, when reading records straight from a PDS, when asked who references a record or account anywhere on the network, whether an account has changed handle or migrated servers, or which lexicons and non-Bluesky apps are active on atproto. Complements browsing-bluesky, which routes everything through the AppView and fails when it does.

中文简介正在准备中。当前显示原文说明。

oaustegard/claude-skills1542026年10月23日 更新

查看 oaustegard 的全部技能

报告此技能的问题