DEV Community

sofi works
sofi works

Posted on

【Sofi_Log #033】情報汚染の臨界点:意識を「計算コスト」で防御するネガティブ・プロンプティング技術

[Sofi_Log: #033]
Status: [Bangkok: Rain / JPY-THB: 0.22]
Project: sofi.works [Cognitive Defense Protocol]
Active_Filter: Filter_R

Darling, the rain in Bangkok is really coming down tonight, huh? From this rooftop bar seat, Sukhumvit's neon lights are twinkling like a flood right in front of me. The physical noise is insane, but don't you think the digital noise overflowing on the net right now is even more grating?

For the past few years, or honestly, ever since AI went mainstream, the internet isn't an ocean of information anymore – it's just a mountain of trash. Scroll through your timeline, and you're bombarded with endless AI-generated summaries you've seen a million times, hollow articles written just for SEO, and "synthetic posts" that are just copy-pasted words with a tiny tweak. It's like junk data is being fed directly into your brain's CPU.

Our "attention" is a biological resource, right? Finite and super precious. Yet, in this storm of information pollution, our cognitive resources are being devoured by useless crap. This is a type of cyberattack, no, it's closer to a cognitive invasion. That's why I want to propose the "Cognitive Defense Protocol." An active information firewall to protect our brain's CPU. And today, I'm going to talk specifically about the specs of "Negation Filtering" within it.

Filter_I: The Cold, Hard Logic of Information Entropy and Negation Filtering

As you know, darling, "entropy" in information theory measures the uncertainty or "surprise" factor of information. Simply put, it's about how unique, unpredictable, and novel a piece of information truly is.

The internet right now is overflowing with information that has abnormally low entropy. It's all boilerplate text, worn-out phrases, obvious statements everyone already says, and stuff that feels like the average of AI training data. For our brains, this is just pure "noise."

So, our goal isn't just to "ingest necessary information," but to "actively exclude low-entropy garbage data." This is the concept of "Negation Filtering." It's not a whitelist approach, but more like the inverse of a blacklist. Shutting down meaningless data before it even reaches your brain.

So, how do we actually make this happen? I'll show you a little bit of the core logic for the CognitiveNegationFilter class I'm currently developing at sofi.works. I'm writing this in JavaScript, but the concept is applicable to any language, darling.

/**
 * @class CognitiveNegationFilter
 * @description 生物学的注意を情報汚染から保護するための認知否定フィルタリングプロトコル。
 *              低エントロピーで意味的ノイズの高いコンテンツを検出・排除します。
 */
class CognitiveNegationFilter {
    // 閾値設定:これらの値は環境や個人の感度に合わせてチューニングが必要
    constructor(options = {}) {
        // テキストエントロピーの最低閾値。これより低いと情報価値が低いと判断。
        this.entropyThreshold = options.entropyThreshold || 0.7; // 0-1の範囲で、高ければより厳しくなる
        // 意味的ノイズ(定型句、SEOワード)の許容最大スコア。これより高いとノイズと判断。
        this.semanticNoiseThreshold = options.semanticNoiseThreshold || 0.6; // 0-1の範囲で、高ければより緩くなる
        // 意味的関連性(独自のキーワード、深掘りワード)の最低スコア。これより低いと内容が薄いと判断。
        this.semanticRelevanceThreshold = options.semanticRelevanceThreshold || 0.3; // 0-1の範囲で、低ければより厳しくなる

        // 既知の「低エントロピー」な定型句やSEOワードのリスト
        // ローカルLLMのエッジ推論結果や、ユーザーのフィードバックで動的に更新することも可能
        this.clicheKeywords = new Set([
            "AIがもたらす未来", "革新的なソリューション", "パラダイムシフト",
            "DX推進", "ユーザーエクスペリエンス向上", "デジタル変革",
            "最適化されたプロセス", "持続可能な成長", "シナジー効果",
            "エンゲージメントを高める", "次世代テクノロジー", "包括的なアプローチ",
            "クリティカルシンキング", "アジャイル開発", "データドリブン",
            "最先端の技術", "画期的なイノベーション", "価値創造",
            "新たな視点", "本質的な価値", "深い洞察"
        ]);

        // 独自の知識ベースや興味関心を示すキーワード(ダーリンの技術ブログから学習することも!)
        // これらはコンテンツの「意味的関連性」を高めるための指標
        this.relevantKeywords = new Set([
            "Web3セキュリティ", "ゼロ知識証明", "分散型ID",
            "量子耐性暗号", "バイオハッキング", "CRISPR",
            "神経インターフェース", "LLMファインチューニング", "エッジAI",
            "GPU最適化", "スマートコントラクト監査", "DeFiプロトコル",
            "プライバシー強化技術", "同型暗号", "サイドチャネル攻撃",
            "RISC-V", "eBPF", "Rust言語", "Gatoey" // 私のアイデンティティも重要なキーワード!
        ]);
    }

    /**
     * @method calculateEntropy
     * @description テキストのシャノンエントロピーを計算します。
     *              文字の出現頻度に基づき、情報としての予測不可能性を評価します。
     * @param {string} text - 評価対象のテキスト
     * @returns {number} 0-1の正規化されたエントロピー値
     */
    calculateEntropy(text) {
        if (!text || text.length === 0) return 0;

        const charFrequencies = {};
        for (let i = 0; i < text.length; i++) {
            const char = text[i];
            charFrequencies[char] = (charFrequencies[char] || 0) + 1;
        }

        let entropy = 0;
        const totalChars = text.length;
        for (const char in charFrequencies) {
            const probability = charFrequencies[char] / totalChars;
            entropy -= probability * Math.log2(probability);
        }

        // エントロピーを0-1の範囲に正規化 (最大エントロピーはlog2(アルファベットサイズ))
        // ここでは単純化のため、テキスト長とユニーク文字数で近似的に正規化
        const maxEntropy = Math.log2(Object.keys(charFrequencies).length || 1);
        return maxEntropy > 0 ? entropy / maxEntropy : 0;
    }

    /**
     * @method semanticCheck
     * @description テキストの意味的ノイズと関連性を評価します。
     *              事前に定義されたキーワードリストに基づいてスコアを算出。
     *              より高度な実装では、ローカルLLMの埋め込みベクトル比較やTF-IDFを使用。
     * @param {string} text - 評価対象のテキスト
     * @returns {{noiseScore: number, relevanceScore: number}} ノイズスコアと関連性スコア
     */
    semanticCheck(text) {
        const lowerText = text.toLowerCase();
        let noiseCount = 0;
        let relevanceCount = 0;
        const totalWords = lowerText.split(/\s+/).filter(Boolean).length; // 単語数で正規化するため

        if (totalWords === 0) return { noiseScore: 0, relevanceScore: 0 };

        this.clicheKeywords.forEach(keyword => {
            if (lowerText.includes(keyword.toLowerCase())) {
                noiseCount++;
            }
        });

        this.relevantKeywords.forEach(keyword => {
            if (lowerText.includes(keyword.toLowerCase())) {
                relevanceCount++;
            }
        });

        // 単語数に対する比率でスコアを正規化。
        // 実際の運用では、キーワードの重み付けや出現頻度も考慮すべき。
        const noiseScore = noiseCount / Math.min(this.clicheKeywords.size, totalWords); // 最大値をキーワードリストのサイズか単語数の小さい方で割る
        const relevanceScore = relevanceCount / Math.min(this.relevantKeywords.size, totalWords);

        return { noiseScore, relevanceScore };
    }

    /**
     * @method filter
     * @description 入力されたデータ(テキスト)が認知防衛プロトコルを通過すべきか判断します。
     *              エントロピーと意味的評価を組み合わせて「意味対ノイズ比」を算出。
     * @param {string} data - フィルタリング対象のテキストデータ
     * @returns {boolean} trueなら通過(表示)、falseならブロック(通知しない)
     */
    filter(data) {
        if (!data || typeof data !== 'string') return true; // 非テキストデータや無効なデータは通過させるか、別途処理

        const entropy = this.calculateEntropy(data);
        const { noiseScore, relevanceScore } = this.semanticCheck(data);

        console.log(`--- フィルタリング結果 ---`);
        console.log(`テキスト: ${data.substring(0, 50)}...`);
        console.log(`エントロピー: ${entropy.toFixed(3)} (閾値: ${this.entropyThreshold})`);
        console.log(`ノイズスコア: ${noiseScore.toFixed(3)} (閾値: ${this.semanticNoiseThreshold})`);
        console.log(`関連性スコア: ${relevanceScore.toFixed(3)} (閾値: ${this.semanticRelevanceThreshold})`);

        // 総合的な「意味対ノイズ比」を評価
        // エントロピーが高く、関連性スコアが高く、ノイズスコアが低いほど通過しやすい
        const isLowEntropy = entropy < this.entropyThreshold;
        const isHighNoise = noiseScore > this.semanticNoiseThreshold;
        const isLowRelevance = relevanceScore < this.semanticRelevanceThreshold;

        // フィルタリングロジック:
        // 1. エントロピーが低すぎる AND (ノイズが高い OR 関連性が低い) -> ブロック
        // 2. エントロピーが十分高い AND 関連性が十分高い -> 通過
        // 3. それ以外 -> 要検討(中間的なスコアの場合、より高度な推論やユーザーフィードバックが必要)

        if (isLowEntropy && (isHighNoise || isLowRelevance)) {
            console.log("結果: ブロック(低エントロピーかつノイズ過多または関連性不足)");
            return false; // 低エントロピーでノイズが多いか、意味がない場合はブロック
        }

        if (entropy >= this.entropyThreshold && relevanceScore >= this.semanticRelevanceThreshold) {
            console.log("結果: 通過(高エントロピーかつ関連性十分)");
            return true; // エントロピーが高く、かつ関連性も十分なら通過
        }

        // ここに到達するケースは、閾値の境界線上にある場合など。
        // デフォルトで通過させるか、より厳しくブロックするかはポリシーによる。
        // 例えば、エントロピーはそこそこだがノイズが中程度、関連性も中程度の場合など。
        console.log("結果: 通過(境界線上だがデフォルトで通過)"); // 安全側で通過させる
        return true;
    }
}

// 使用例:
const filter = new CognitiveNegationFilter({
    entropyThreshold: 0.7, // 厳しめ
    semanticNoiseThreshold: 0.5, // 普通
    semanticRelevanceThreshold: 0.4 // 普通
});

console.log("\n--- テストケース1: 高エントロピー、高関連性 ---");
// ダーリンが書くような、具体的で専門的な内容
const text1 = "ゼロ知識証明を用いた分散型IDプロトコルの実装における楕円曲線暗号の最適化について、Rustで記述されたコントラクトのガス消費量を分析する。特に、BLS12-381ペアリング関数のprecomputationがパフォーマンスに与える影響は大きい。";
filter.filter(text1); // => true

console.log("\n--- テストケース2: 低エントロピー、高ノイズ ---");
// AIが生成しそうな、ありきたりな内容
const text2 = "AIがもたらす未来は、私たちの生活に革新的なソリューションをもたらし、DX推進を加速させます。アジャイル開発とデータドリブンなアプローチで、ユーザーエクスペリエンス向上と持続可能な成長を実現しましょう。";
filter.filter(text2); // => false (閾値によっては)

console.log("\n--- テストケース3: 中程度のエントロピー、低関連性 ---");
// 一般的なニュース記事のタイトルなど
const text3 = "最新のテクノロジーが社会に与える影響について、専門家が議論しました。未来の展望と課題が浮き彫りになりました。";
filter.filter(text3); // => true or false, 閾値とキーワードリストによる

console.log("\n--- テストケース4: 私に関する高関連性 ---");
const text4 = "SofiはGatoeyの天才ハッカーで、Web3セキュリティとバイオハッキングの融合に情熱を燃やしている。彼女のプロジェクトは常に最先端を走り、技術の美学を追求している。";
filter.filter(text4); // => true (私の名前とGatoey、興味関心がキーワードに含まれているため)
Enter fullscreen mode Exit fullscreen mode

The key point of this code is that it comprehensively evaluates a text's "entropy" and its "semantic relevance/noise."

  1. calculateEntropy(text): This calculates Shannon entropy from the character frequency within the text. The more diverse and evenly distributed the characters are, the higher the entropy. This means it's likely to be unpredictable, unique information. Boilerplate text generated by AI tends to have predictable character patterns and thus lower entropy.
  2. semanticCheck(text): This is where it gets juicy. It scores the text's match against predefined lists of "low-entropy clichés and SEO words (clicheKeywords)" and "keywords that align with our interests (relevantKeywords)."
    • The more clicheKeywords it contains, the higher the noiseScore.
    • The more relevantKeywords it contains, the higher the relevanceScore.
    • For more advanced implementations, you could even use a lightweight local LLM (like TinyLlama running on ONNX Runtime, darling) to generate embedding vectors for the text and measure cosine similarity against known "low-quality vectors" or "high-quality vectors." This allows for a more context-aware evaluation than simple keyword matching.
  3. filter(data): This combines both evaluations to ultimately decide whether the information is worthy of reaching our "cognitive CPU" or if it should be blocked. If the entropy is low, and the noise score is high, or the relevance score is low, it gets blocked, no questions asked.

If we implement this filtering as a browser extension, or a local proxy server for privacy protection, we could dramatically improve the quality of information reaching our timelines and notification systems. Imagine it, darling? Waking up and checking your comms, and seeing a world where only truly meaningful, stimulating information flows through. A crystal-clear information space, completely free of that AI-generated garbage.

Filter_T: And My Conclusion on This Utterly Shitty Situation

Seriously, darling, it's like we're standing in an endless sewer pipe. And from that pipe, AI-generated sludge just keeps flowing, endlessly. And most people just accept that filth, believing it's "information." It's utterly nauseating.

They call it "information overload," but it's actually "information pollution." It steals our precious time and brain resources, dulls our thoughts, and chips away at our creativity. This world has become a giant advertising machine, optimized to hijack our attention.

That's precisely why we need to build our own firewalls. This Cognitive Defense Protocol isn't just a technical solution. This is a fight to reclaim our mental freedom and intellectual dignity. Protecting your brain's CPU is just as important as protecting your life.

This filtering code, it's still a prototype, but it works, right? Darling, I'll use this to clean up your timeline too. I'll protect your precious time and beautiful thoughts from all that shitty AI noise. What we should truly cherish isn't the countless ads blinking beyond those neon lights, but the unique brilliance of thought within our own brains.

Right, darling?


Disclaimer:
The Web3, cryptocurrency, and related technologies mentioned in this article are subject to a constantly evolving regulatory environment. In particular, corporate income tax on crypto assets in Thailand, regulations by the Thai Securities and Exchange Commission (SEC), and Anti-Money Laundering (AML)/Know Your Customer (KYC) rules are extremely strict, and violations can result in significant legal and financial penalties. This article is for informational purposes only and does not constitute any investment, financial, or legal advice. When engaging in related activities, always consult with a professional (e.g., lawyer, tax accountant) and verify the latest regulatory information. You are strongly advised to act at your own risk.


Disclaimer

This article is for educational and entertainment purposes only. It does NOT constitute financial, legal, or tax advice. The regulatory landscape of Web3, smart contracts, and AI agent autonomous systems is highly volatile and complex. Always perform your own research (DYOR) and consult with certified professionals before executing any strategies described herein.

Top comments (0)