
2026/09/23 16:26
Jev を 25 行の Python で実装する
RSS: https://news.ycombinator.com/rss
要約▶
Japanese Translation:
このプロジェクトは、Jev の簡素化されたローカル Python 実装であり、軽量な Qwen3-0.6B-GGUF モデルを電子メールの脅威検出に使用します。外部 API を使用せずに高度なセキュリティタスクを実行できることを示しています。Python >=3.12、llama-cpp-python、huggingface-hub、numpy などの依存関係で動作し、A、B、C の 3 つの選択肢をラベル(Legitimate、Spam、Phishing)にマッピングしたプロンプトをロードします。入力例として、給与に関するフィッシング電子メールについて記述し、非企業サインインページでの認証情報の要求を示すものは、0.031 の確率で Legitimate、0.084 の確率で Spam、0.885 の確率で Phishing と分類されます。API 呼び出しや RLCD(強化学習に基づく校正)を回避することで、機密データを完全にローカルに保持し、「NobodyWho」の哲学に沿い、OpenJev、OpenJev-sglang、および DiffusionGemma 上の OpenJev のような他のオープン実装と並んでいます。2026 年 9 月 22 日に Duarte O.Carmo によって発表されたこの作業は、軽量な LLM が重厚なインフラストラクチャや商業的依存関係に依存せず、ユーザーのハードウェア上で直接高信頼性の脅威分類を交付することを示しています。
Text to translate:
The project presents a streamlined, local Python implementation of Jev that uses the lightweight Qwen3-0.6B-GGUF model for email threat detection, demonstrating that advanced security tasks can be performed without external APIs. Running on Python >=3.12 with dependencies such as llama-cpp-python, huggingface-hub, and numpy, the system loads a prompt offering three choices (A, B, C) mapped to labels: Legitimate, Spam, and Phishing. An example input—describing a phishing email about payroll requesting credentials on a non-company sign-in page—is classified with calculated probabilities of 0.031 for Legitimate, 0.084 for Spam, and 0.885 for Phishing. By avoiding API calls and reinforcement learning–based calibration (RLCD), the setup keeps sensitive data entirely local, aligning with the "NobodyWho" philosophy and standing alongside other open implementations like OpenJev, OpenJev-sglang, and OpenJev on DiffusionGemma. Published on September 22, 2026, by Duarte O.Carmo, this work shows that lightweight LLMs can operate independently of heavy infrastructure or commercial dependencies while still delivering high-confidence threat classification directly on user hardware.
本文
「ジェヴ」:わずか 25 行で理解する AI の新たなフロンティア
Twitter 上では「ジェヴ」という言葉が熱い話題となっています。大規模言語モデルや AI パラダイムの次のステップとして称賛され、人々が翻弄されるほどの注目を集めています。しかし、その本質はもっとシンプルに捉えられます。わずか 25 行の Python コードで、「これがジェヴです」とご紹介します。
🚀 動作する Python コード(25 行)
以下のコードをコピーして実行してください。任意の GGUF モデルを使用可能です。
# /// script # requires-python = ">=3.12" # dependencies = ["huggingface-hub", "llama-cpp-python", "numpy"] # /// import numpy from llama_cpp import Llama # さすがに、https://huggingface.co/models?library=gguf より任意の GGUF モデルを使用可能です。 model = Llama.from_pretrained( repo_id="Qwen/Qwen3-0.6B-GGUF", filename="Qwen3-0.6B-Q8_0.gguf", n_ctx=512, logits_all=True, verbose=False, ) # プロンプトを読み込み、選択肢を定義します。 labels = ["A", "B", "C"] choices = ["本物", "スパム", "フィッシング"] email = "給与部門が会社のログインページではない場所からパスワードを求めてきました。" options = "\n".join( f"{label}. {choice}" for label, choice in zip(labels, choices, strict=True) ) prompt = f"""{choices} メール: {email}\n\n{options} """ model.eval(tokens=model.tokenize(text=prompt.encode(), add_bos=False, special=True)) # ロジットを確率に変換します。 logits = model.scores[model.n_tokens - 1] token_ids = [model.tokenize(text=label.encode(), add_bos=False)[0] for label in labels] choice_logits = numpy.asarray([logits[token_id] for token_id in token_ids]) logprobs = choice_logits - numpy.logaddexp.reduce(choice_logits) probabilities = numpy.exp(logprobs) for name, scores in ( ("ロジット", choice_logits), ("ログ確率", logprobs), ("確率", probabilities), ): values = numpy.round(scores.astype(float), 3).tolist() print(f"{name}:", dict(zip(choices, values, strict=True))) # ロジット: {'本物': 26.254, 'スパム': 27.262, 'フィッシング': 29.614} # ログ確率: {'本物': -3.482, 'スパム': -2.474, 'フィッシング': -0.122} # 確率: {'本物': 0.031, 'スパム': 0.084, 'フィッシング': 0.885}
💡 「ジェヴ」の本質とは?
コードを実行した結果、あなたは「まだ理解していない」と感じるかもしれません。しかし、ここが重要になります。我々はこの技術を以下のような過大評価された言葉には呼びません。
- システム一決定モデルではない
- API をただ呼び出すだけではない
- 数千もの合成データを生成していない
- 強化学習による校准(RLCD)で訓練されていない
(※ただし、RLCD が常に正しいとは限りません)
そもそも「ジェヴ」の正体
これは非常にシンプルです。プロンプトに選択肢を含め、モデルから確率を出力する分類タスクを行います。
その素晴らしい特徴は以下の通りです:
- 高速: 即時の応答が可能
- ローカル動作: サーバーへ送信せず、個人のデバイス上で完結
- プライバシー保護: ユーザーデータを外部に送信する必要がない
重要: 我々はユーザーのデータを外部へ送信することを好まず、**「NobodyWho」**の理念を共有しています。(※パロディブログ投稿ですが、より完成度が高いオープンソース実装は後述のリンクをご覧ください)
オープンソースへの貢献
NobodyWho が行うすべての活動はオープンソースです。プロジェクトを支援したい場合は、お気に入りの Github リポジトリに**スター(★)**を付けてください ❤️
公開日:2026 年 9 月 22 日 | 著者:Duarte O.Carmo | カテゴリ:技術