<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Paul Xiong on Medium]]></title>
        <description><![CDATA[Stories by Paul Xiong on Medium]]></description>
        <link>https://medium.com/@paulxiong?source=rss-76324cba9987------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*jt1LAmH9FN8uDrcD.jpg</url>
            <title>Stories by Paul Xiong on Medium</title>
            <link>https://medium.com/@paulxiong?source=rss-76324cba9987------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 04:02:38 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@paulxiong/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[My observation: the hallucination is not fixable?]]></title>
            <link>https://paulxiong.medium.com/my-observation-the-hallucination-is-not-fixable-d29894f34b53?source=rss-76324cba9987------2</link>
            <guid isPermaLink="false">https://medium.com/p/d29894f34b53</guid>
            <category><![CDATA[uhella]]></category>
            <category><![CDATA[hallucinations]]></category>
            <category><![CDATA[ai-hallucination]]></category>
            <category><![CDATA[ai-photo]]></category>
            <category><![CDATA[photos]]></category>
            <dc:creator><![CDATA[Paul Xiong]]></dc:creator>
            <pubDate>Fri, 19 Jun 2026 16:09:33 GMT</pubDate>
            <atom:updated>2026-06-19T16:09:33.805Z</atom:updated>
            <content:encoded><![CDATA[<p>— — chatGPT does not agree.</p><h3>Introduction</h3><p>This discussion was inspired by a real debugging incident in the Uhella project.</p><p>During the investigation of what initially appeared to be a hallucination problem, I discovered that the underlying cause was not the language model itself, but a routing failure within the application. A Chinese-language photo search query was incorrectly routed to a conversational fallback prompt, causing the model to generate chat-oriented responses rather than structured search output.</p><p>The incident raised an important question: How much of what we call “hallucination” is actually caused by the model, and how much is introduced by the surrounding application architecture?</p><p>My interpretation was that many hallucinations originate from system design choices — such as routing, retrieval, prompt selection, context construction, and tool orchestration. Because these failures can occur at many layers of an AI application, I began to suspect that hallucinations cannot be solved by any single universal mechanism and must instead be addressed through application-specific engineering.</p><p>ChatGPT disagreed with part of that conclusion and argued that while there may be no single solution, architectural patterns can systematically eliminate entire categories of failures.</p><p>The following conversation explores both viewpoints and examines the distinction between model hallucinations and system-induced hallucinations.</p><h3>Hallucination vs Application-Layer Failures in LLM Systems</h3><h3>User Observation</h3><p>A routing system selects:</p><ul><li>core.md (always)</li><li>Best matching sub-prompt:</li><li>photo_search.md</li><li>conversation.md</li><li>fallback.md</li></ul><p>Routing is based on cosine similarity against English prompt descriptions.</p><p>Example query:</p><pre>阿根廷，梅西，照片</pre><p>Observed behavior:</p><ul><li>Similarity to all English descriptions falls below 0.46</li><li>Router selects fallback.md</li><li>Logs show selected=fallback score=0.000</li><li>Equivalent English query routes correctly to photo_search.md</li></ul><p>Conclusion:</p><p>This appears to be a cross-lingual embedding gap rather than a random model failure.</p><h3>Why Routing Matters</h3><p>The user inspected the prompts and found:</p><h3>fallback.md / conversation.md</h3><p>Encourage:</p><pre>{<br>  &quot;reply&quot;: &quot;...&quot;,<br>  &quot;format&quot;: &quot;reply&quot;<br>}</pre><p>Behavior:</p><ul><li>Friendly responses</li><li>Ambiguity handling</li><li>Chat-oriented output</li></ul><h3>photo_search.md</h3><p>Contains examples such as:</p><pre>{<br>  &quot;content&quot;: &quot;animals&quot;,<br>  &quot;place&quot;: &quot;Kenya&quot;,<br>  &quot;format&quot;: &quot;photos&quot;<br>}</pre><p>Behavior:</p><ul><li>Structured extraction</li><li>Search-oriented output</li></ul><p>Therefore Chinese photo-search requests are systematically routed toward a prompt that encourages conversation rather than extraction.</p><h3>User’s Argument</h3><p>The user argued:</p><p>&gt; Hallucination is not fixable by a single implementation mechanism.</p><p>&gt; Application-layer design can introduce hallucination-like failures.</p><p>&gt; Fixes are often case-by-case because each architecture creates different failure modes.</p><h3>Assistant Counterpoint</h3><p>The assistant argued that the observed issue is largely an implementation problem rather than pure model hallucination.</p><p>Failure chain:</p><pre>Chinese Query<br>    ↓<br>Embedding Router<br>    ↓<br>Wrong Prompt<br>    ↓<br>Chat Behavior<br>    ↓<br>Fake Progress Response</pre><p>In this case the model may simply be following the prompt it received.</p><h3>Proposed Engineering Fixes</h3><h3>1. Translate Before Routing</h3><pre>阿根廷，梅西，照片<br>    ↓<br>Argentina, Messi, photos<br>    ↓<br>Route</pre><h3>2. Multilingual Routing Descriptions</h3><p>Store both English and Chinese descriptions.</p><h3>3. Adjust Similarity Threshold</h3><p>Reduce the cutoff if appropriate.</p><h3>4. Intent Classifier</h3><p>Simple keyword routing:</p><pre>照片<br>图片<br>相册<br>photo<br>image</pre><p>→ Force photo search path.</p><h3>5. LLM-Based Routing</h3><p>Ask a model to choose:</p><pre>photo_search<br>conversation<br>fallback</pre><p>before execution.</p><h3>User’s Rebuttal</h3><p>The user observed:</p><p>&gt; Your fixes actually support my argument.</p><p>&gt;</p><p>&gt; There is no standard mechanism that prevents hallucinations introduced by the application layer.</p><h3>Final Synthesis</h3><p>The discussion converged on the following distinction:</p><h3>There is no universal anti-hallucination mechanism</h3><p>Different layers can fail:</p><pre>User<br>  ↓<br>Router<br>  ↓<br>Prompt Selection<br>  ↓<br>Retriever<br>  ↓<br>Tool Selection<br>  ↓<br>Context Assembly<br>  ↓<br>LLM<br>  ↓<br>Post Processing</pre><p>Failures can originate anywhere.</p><p>Examples:</p><p>LayerFailureRouterWrong promptRetrieverWrong factsToolWrong toolContextMissing informationPromptConflicting instructionsPost-processCorrupted outputModelFabricated facts</p><p>No single technique prevents all of them.</p><h3>However, architectural patterns can eliminate classes of failures</h3><p>Examples:</p><ul><li>Multilingual routing</li><li>Translation before routing</li><li>Confidence scoring</li><li>Verification layers</li><li>Structured outputs</li><li>Better retrieval validation</li></ul><p>These are not one-off fixes; they reduce entire categories of errors.</p><h3>Key Insight</h3><p>Many things users call “hallucinations” are actually:</p><p>&gt; System design defects expressed through a probabilistic model.</p><p>The visible symptom is generated by the model, but the root cause may exist earlier in the pipeline.</p><h3>Takeaway</h3><p>The debate is not whether hallucinations exist.</p><p>The deeper question is:</p><p>&gt; How much of the observed hallucination is caused by the model itself, and how much is introduced by the surrounding application architecture?</p><p>This conversation suggests that a significant portion of practical hallucination problems in agent systems originate from routing, retrieval, prompting, and orchestration layers rather than the base model alone.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d29894f34b53" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Keep Forever Feature Overview]]></title>
            <link>https://paulxiong.medium.com/keep-forever-feature-overview-8bb780c352e1?source=rss-76324cba9987------2</link>
            <guid isPermaLink="false">https://medium.com/p/8bb780c352e1</guid>
            <category><![CDATA[icloud]]></category>
            <category><![CDATA[icloud-bypass]]></category>
            <category><![CDATA[icloud-drive]]></category>
            <dc:creator><![CDATA[Paul Xiong]]></dc:creator>
            <pubDate>Tue, 16 Jun 2026 14:45:33 GMT</pubDate>
            <atom:updated>2026-06-16T14:45:33.102Z</atom:updated>
            <content:encoded><![CDATA[<h3>What is Keep Forever?</h3><p>Uhella automatically creates a special album called “Keep Forever” on iCloud when it is installed and running on your Mac mini.</p><h3>How It Works</h3><ul><li>Uhella acts as an iCloud extender, allowing you to define how many photos you want to keep in iCloud.</li><li>Once this number is exceeded, older photos are automatically moved to a backup archive.</li><li>This entire process is seamless and managed automatically by Uhella.</li></ul><h3>Benefits for Users</h3><ul><li>Users can keep a defined number of key photos in iCloud without manual cleanup.</li><li>Older images are safely archived but still accessible, giving peace of mind.</li></ul><h3>Next Steps</h3><ul><li>Explore how Uhella can simplify your iCloud storage management.</li></ul><p><a href="https://github.com/paulxiong/uhella">https://github.com/paulxiong/uhella</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8bb780c352e1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Uhella QA Harness: How It Works]]></title>
            <link>https://paulxiong.medium.com/uhella-qa-harness-how-it-works-bbfb24bf585a?source=rss-76324cba9987------2</link>
            <guid isPermaLink="false">https://medium.com/p/bbfb24bf585a</guid>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[harness]]></category>
            <category><![CDATA[self-improvement]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[local-model]]></category>
            <dc:creator><![CDATA[Paul Xiong]]></dc:creator>
            <pubDate>Thu, 11 Jun 2026 22:43:32 GMT</pubDate>
            <atom:updated>2026-06-11T22:43:32.474Z</atom:updated>
            <content:encoded><![CDATA[<h3>Overview</h3><p>The QA harness is a fully autonomous quality-assurance loop for the Uhella photo search backend. It generates natural-language queries, sends them through the real Telegram client to the live backend, evaluates the results, and attempts to auto-fix any failures — all without human intervention. Every AI call goes to a local <strong>Qwen</strong> model running on macbook-air-6 (8G RAM)via Ollama; there are <strong>zero cloud API calls</strong> during a run.</p><p>Claude Code (this session) acts as a <strong>supervisor</strong>: it monitors run results, investigates persistent failures, and makes targeted code edits when the autonomous loop cannot fix something on its own.</p><p>You can try it : <a href="https://github.com/paulxiong/uhella">https://github.com/paulxiong/uhella</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AvCt3H5QMdjo722b-N4GUA.png" /></figure><h3>System Architecture</h3><pre>┌─────────────────────────────────────────────────────────┐<br>│                  qa_harness_qwen.py                     │<br>│           (thin CLI wrapper — sets up config)            │<br>└────────────────────────┬────────────────────────────────┘<br>                         │<br>                         ▼<br>┌─────────────────────────────────────────────────────────┐<br>│                    qa_harness.py                        │<br>│               (all orchestration logic)                 │<br>│                                                         │<br>│  BackendManager  ──►  uvicorn (agent.py)                │<br>│  TrafficPoller   ──►  mitmproxy (captures HTTP)         │<br>│  TelegramSender  ──►  Telegram desktop (AppleScript)    │<br>│  QuestionGenerator ─►  Qwen (macbook-air-6:11434)       │<br>│  ClaudeEvaluator ──►  Qwen (macbook-air-6:11434)        │<br>│  CodeFixer       ──►  Qwen (macbook-air-6:11434)        │<br>└─────────────────────────────────────────────────────────┘<br>                         │<br>                         ▼<br>┌─────────────────────────────────────────────────────────┐<br>│           macbook-air-6: Ollama (qwen2.5:7b)            │<br>│   • question generation   • pass/fail evaluation        │<br>│   • diff generation       • diff self-validation        │<br>└─────────────────────────────────────────────────────────┘</pre><h3>Step 1 — Startup</h3><p>BackendManager sets up the capture environment before any questions are asked:</p><ol><li>Kills any existing processes on the monitored ports (8765–8770).</li><li>Starts <strong>five mitmproxy</strong> reverse proxies — one each for the backend, LLM, embedding, VLM, and foreground services. Every HTTP request the backend makes is logged to ~/.uhella_backend/qa_traffic.ndjson.</li><li>Starts <strong>uvicorn</strong> (agent.py) behind the backend proxy on port 8766.</li><li>Polls /health until the backend is ready.</li></ol><p>LibrarySampler then queries the running backend to discover what&#39;s actually in the photo library: cities, countries, years with photos, video presence, and a sample of VLM captions. This context is passed to every subsequent Qwen call so questions and evaluations are grounded in the real library.</p><h3>Step 2 — Question Generation (Qwen)</h3><p>QuestionGenerator asks Qwen to produce test questions that exercise the backend&#39;s search capabilities.</p><p><strong>Prompt sent to Qwen</strong> (_QUESTION_PROMPT):</p><ul><li>Library contents: cities, countries, years, subjects detected from VLM captions</li><li>Up to 15 recently-passed questions (so Qwen avoids duplicates)</li><li>A list of categories to cover: location, date, subject, event, media_type, complex</li><li>Instruction to return a JSON array of {category, question} objects</li></ul><p><strong>Deduplication</strong>: The harness maintains a cache of up to 500 previously-passed questions (qa_passed_questions.json). Any generated question that fuzzy-matches a cached one is dropped and a replacement is requested (up to 3 rounds).</p><h3>Step 3 — Sending &amp; Capturing (per question)</h3><p>For each question, _run_one() does the following:</p><ol><li><strong>Send</strong>: TelegramSender uses AppleScript to focus the Telegram desktop app, open the Uhella chat via Cmd+K, and type the question.</li><li><strong>Wait</strong>: TrafficPoller reads new lines from qa_traffic.ndjson every second, looking for a /agent response timestamped after the send time. Default timeout: <strong>90 seconds</strong>. If no response arrives, uvicorn is restarted to drain any in-flight Ollama requests that are blocking the queue.</li><li><strong>Capture</strong>: Once the /agent response arrives, get_traffic_window() collects all HTTP entries in the surrounding time window (LLM calls, embedding calls, etc.).</li></ol><h3>Step 4 — Evaluation (Qwen)</h3><p>ClaudeEvaluator.evaluate() sends the captured data to Qwen and asks for a structured judgment.</p><p><strong>Prompt sent to Qwen</strong> (_EVAL_PROMPT, ~7K chars):</p><p>SectionContentDate contextToday’s date, last year, last month — so “last summer” is unambiguousEvaluation rules8+ conditional rules: vacation queries, combined content+location queries, empty-year results, infra errors, etc.Library blockCities, countries, years, video presenceQuestion + categoryThe test question being evaluatedBackend responseFirst 2000 chars of the /agent JSON responseTraffic summaryLast 10 LLM/embed requests with status codes and durationsServer logLast 30 ERROR/CRITICAL/Traceback lines from server.log</p><p><strong>Qwen returns JSON</strong>:</p><pre>{<br>  &quot;passed&quot;: true,<br>  &quot;confidence&quot;: 0.9,<br>  &quot;reason&quot;: &quot;SQL correctly filters by year=2024 and month=2&quot;,<br>  &quot;failure_type&quot;: &quot;none&quot;,<br>  &quot;suggested_fix&quot;: &quot;&quot;<br>}</pre><p>failure_type is one of: none · no_results · wrong_results · error · timeout · wrong_model · infra_error</p><p><strong>Robustness</strong>: _parse_eval_json() strips Qwen3 &lt;think&gt;...&lt;/think&gt; blocks and markdown fences, then tries multiple JSON extraction strategies before giving up with EVAL_ERROR.</p><h3>Step 5 — Auto-Fix Loop (Qwen)</h3><p>If a question fails evaluation and retries remain, CodeFixer.fix() asks Qwen to generate a patch.</p><h3>What Qwen receives</h3><p><strong>Prompt</strong> (_FIX_PROMPT, ~14K chars total):</p><p>FieldContentQuestion + categoryThe failing testResponse JSONFirst 1500 chars of the /agent responseFailure type + reasonFrom the evaluatorSuggested fixThe evaluator&#39;s hint (may be empty)Generated SQLExtracted from traffic — the actual SQL that ranFile excerpts<strong>Targeted</strong> sections of agent.py based on category and keywords (see below)Failed attemptsDiffs from previous rejected patches, with rejection reason</p><h3>Smart file excerpting</h3><p>Instead of sending the top 6000 chars of agent.py (which is just imports), the harness uses _smart_excerpt_for_fix() to find the functions actually relevant to the failure:</p><p>CategoryFunctions targeteddate_extract_holiday_date_hint, _HOLIDAY_PATS, _extract_intent_hintsevent_extract_intent_hints, _HOLIDAY_PATS, _m_before blocksubject_extract_intent_hints, _m_before block, selfie extractionlocation_extract_intent_hints, _normalise_place_token, _KNOWN_COUNTRY_TOKENScomplex_extract_intent_hints, _m_before, _HOLIDAY_PATSmedia_type_extract_intent_hints, media_type/video handling</p><p>Keywords in the question and failure reason further refine the target list (e.g. “christmas” → also include _HOLIDAY_PATS). Each found function is extracted as raw file content (no prefixes that would confuse patch(1)) with a header showing the exact line range.</p><h3>Applying the patch</h3><p>Qwen returns a unified diff. OllamaProvider.agentic_fix() writes it to a temp file and applies it with patch -p1. If patch fails (mismatched context), the summary starts with &quot;patch failed&quot; and no file was changed.</p><h3>Patch self-validation</h3><p>After a successful patch apply, _validate_fix() asks Qwen a short second question:</p><pre>A code fix was applied. Here is the exact change made:<br>{actual_diff}</pre><pre>The bug was: [wrong_results] SQL used city column for christmas party query<br>Expected fix: fix holiday detection in _extract_intent_hints</pre><pre>Does this change directly address the stated bug?<br>Return ONLY JSON: {&quot;validates&quot;: true/false, &quot;concern&quot;: &quot;...&quot;}</pre><p>If validates=false, _revert_fix_files() restores the <strong>pre-patch file snapshot</strong> (not git checkout HEAD — that would wipe unrelated session fixes). The rejected diff and concern are accumulated in failed_attempts and prepended to the next fix prompt so Qwen tries a different approach.</p><h3>Retry loop</h3><pre>for attempt in 0..max_retries:<br>    send question → wait for /agent response → evaluate<br>    if PASS  → done ✓<br>    if EVAL_ERROR  → skip (evaluator itself failed)<br>    if infra_error → skip auto-fix (cannot fix with code edits)<br>    if FAIL:<br>        snapshot = save current file contents<br>        diff = Qwen generates unified diff<br>        patch -p1 applies it<br>        if patch succeeded:<br>            validate diff with Qwen<br>            if rejected:<br>                restore snapshot<br>                add (diff, concern) to failed_attempts<br>                continue (no backend restart)<br>            else:<br>                restart backend → next attempt<br>        else:<br>            continue (no file changed, no restart)</pre><h3>Step 6 — Results &amp; Cache</h3><p>After all questions:</p><ul><li><strong>Passed cache</strong> (qa_passed_questions.json, limit 500): questions that passed are added; failed questions are removed. Used to avoid regenerating the same questions in future runs.</li><li><strong>Failed cache</strong> (qa_failed_questions.json): questions that failed after all retries. Re-runnable with --rerun-failed.</li><li><strong>Results JSON</strong> (qa_results_YYYYMMDD_HHMMSS.json): full record of every question&#39;s outcome, eval reason, traffic count, and fix summaries.</li></ul><h3>Claude’s Supervisory Role</h3><p>The harness is autonomous — Qwen handles generation, evaluation, and fixing. Claude Code (this session) steps in when:</p><ol><li><strong>Patches corrupt files</strong>: If a Qwen-generated diff breaks the backend (syntax error, wrong section changed), Claude reads the git diff, identifies the damage, and makes a targeted surgical edit to restore correctness.</li><li><strong>Persistent failures after all retries</strong>: If a question category fails repeatedly across runs, Claude investigates the traffic logs, reads the relevant agent.py functions, and applies a hand-crafted fix that Qwen couldn&#39;t reach (e.g., the _m_before stop-word stripping, holiday possessive lookahead, selfie detection).</li><li><strong>Infrastructure issues</strong>: Timeout cascades (macbook-air-6 Ollama overloaded), connectivity failures, or backend crashes are diagnosed and resolved here.</li><li><strong>Prompt improvement</strong>: When Qwen’s evaluator or fixer consistently makes wrong judgments, Claude improves the prompt rules (e.g., the vacation-query evaluator rule, the infra_error classification).</li></ol><p>The goal is that Claude’s interventions become rarer over time as the harness and prompts improve.</p><h3>Running It</h3><pre># Standard run (15 questions, all categories)<br>python3 mac_mini/qa_harness_qwen.py --questions 15</pre><pre># Only re-run previously failed questions<br>python3 mac_mini/qa_harness_qwen.py --rerun-failed</pre><pre># See the fix diff Qwen generates (debugging)<br>python3 mac_mini/qa_harness_qwen.py --questions 5 --verbose-fix</pre><pre># Skip patch self-validation (faster, but blind)<br>python3 mac_mini/qa_harness_qwen.py --questions 15 --skip-fix-validation</pre><pre># Use a different Ollama host or model<br>python3 mac_mini/qa_harness_qwen.py --host <a href="http://my-machine:11434/">http://my-machine:11434</a> --model qwen2.5:14b</pre><h3>Key Files</h3><p>FileRolemac_mini/qa_harness_qwen.pyCLI entry point; configures OllamaProvider and BatchConfigmac_mini/qa_harness.pyAll orchestration: BackendManager, TrafficPoller, TelegramSender, QuestionGenerator, ClaudeEvaluator, CodeFixer, _run_one(), run_batch()mac_mini/qa_harness_providers.pyProvider abstraction; OllamaProvider handles Ollama chat + diff-based fixingmac_mini/agent.pyThe backend being tested; _extract_intent_hints() (line ~3074) is where most fixes landmac_mini/intent_classifier.pySecondary fix target for intent classification changes~/.uhella_backend/qa_traffic.ndjsonLive HTTP traffic log written by mitmproxy~/.uhella_backend/qa_passed_questions.jsonCache of up to 500 passed questions (dedup source)~/.uhella_backend/qa_results_*.jsonPer-run result archives</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bbfb24bf585a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Uhella — Your Private Photo Memory]]></title>
            <link>https://paulxiong.medium.com/uhella-your-private-photo-memory-ad5890b3dfcb?source=rss-76324cba9987------2</link>
            <guid isPermaLink="false">https://medium.com/p/ad5890b3dfcb</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[google-photos]]></category>
            <category><![CDATA[photos]]></category>
            <category><![CDATA[icloud]]></category>
            <category><![CDATA[annotations]]></category>
            <dc:creator><![CDATA[Paul Xiong]]></dc:creator>
            <pubDate>Wed, 25 Mar 2026 16:33:52 GMT</pubDate>
            <atom:updated>2026-03-25T17:07:34.781Z</atom:updated>
            <content:encoded><![CDATA[<h3>Your entire photo library. Searchable by memory, not just keywords. Accessible from anywhere, privately.</h3><h3>Uhella Works Alongside Google Photos and iCloud</h3><p>Uhella is not a replacement for Google Photos or iCloud — keep using them exactly as you do today for backup, sync, and sharing. Uhella is a companion that sits on top of whatever you already have.</p><p>Think of it this way: Google Photos and iCloud are excellent at storing and syncing your photos across devices. What they don’t do is let you have a real conversation about your memories, teach them who people are, correct mistakes, or have them proactively resurface something meaningful while you’re chatting with family.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v7LzzVbGhcLhtAXAR6-L8w.png" /></figure><p>Keep Google Photos or iCloud for what they’re good at. Add Uhella for the part they’ve never done — actually talking to your photos.</p><p>Google Photos and iCloud are great for storage and basic search. But they work on <strong>their</strong> terms — your photos live on their servers, their AI decides what matters, and you can’t teach them anything. The moment you cancel, your access gets complicated.</p><p>Uhella is different: the AI runs on your Mac, your photos never move, and <strong>you</strong> train it over time by just chatting.</p><h3>Why a Mac Mini?</h3><p>Uhella needs a computer that’s always on, always home. A Mac Mini is the perfect fit:</p><ul><li><strong>Always awake</strong> — it sits quietly on your desk or shelf, running 24/7</li><li><strong>Silent and small</strong> — about the size of a thick paperback book, no noise</li><li><strong>Low power</strong> — uses roughly as much electricity as a light bulb</li><li><strong>Your Mac, your rules</strong> — the AI model runs entirely on it, no cloud needed</li><li><strong>Works with your existing Photos library</strong> — no migration, no copying, no changes</li></ul><p>You don’t need to do anything special. As long as the Mac Mini is on and connected to the internet, your Telegram bot works from anywhere in the world — at home, traveling, wherever.</p><p>If you already have a Mac that’s always on, that works too. A Mac Mini is simply the most practical dedicated device for this.</p><h3>Installation — How Hard Is It?</h3><p>Honest answer: <strong>about 10 minutes</strong>, and most of it is waiting, not doing.</p><p>Here’s the full process:</p><ol><li><strong>Download</strong> the Uhella app from <a href="https://github.com/paulxiong/uhella/releases/tag/1.1.8">github.com/paulxiong/uhella/releases/tag/1.1.8</a> — one .dmg file, drag it to Applications, open it</li><li><strong>Grant Photos access</strong> — macOS will ask, click Allow</li><li><strong>Create a Telegram bot</strong> — Telegram has a built-in “BotFather” account; send it one message, copy the token it gives you</li><li><strong>Paste the token</strong> into Uhella’s settings window</li><li><strong>Wait</strong> — Uhella quietly reads and describes your entire library in the background (a few hours for large libraries, nothing you need to watch)</li><li><strong>Open Telegram and start chatting</strong></li></ol><p>That’s it. No terminal, no configuration files, no developer tools required.</p><blockquote><em>If you’re comfortable installing a Mac app and sending a Telegram message, you can set this up.</em></blockquote><h3>Will It Change or Delete My Photos?</h3><p><strong>No. Uhella never touches your photos.</strong></p><ul><li>It reads your Photos library the same way a slideshow screensaver would — as a viewer, not an editor</li><li>It cannot move, rename, delete, or modify any photo</li><li>It stores its own notes (descriptions, search index) in a separate database file that has nothing to do with your Photos app</li><li>If you uninstall Uhella, your Photos library is exactly as you left it</li></ul><p>Your photos are safe. The only thing Uhella writes to disk is its own index — a set of notes about your photos that it uses to answer your questions.</p><h3>Why Telegram?</h3><p>It might seem like an unusual choice. Here’s why it works so well:</p><p><strong>You already have it.</strong> Most people have Telegram on their phone, tablet, and computer. No new app to learn.</p><p><strong>It works everywhere.</strong> Your bot is reachable whether you’re on your home WiFi or traveling in another country. As long as Telegram works, Uhella works.</p><p><strong>It’s a real conversation.</strong> Unlike a photo search app where you type in a box and scroll results, Telegram feels like asking someone. You can follow up, correct, refine, and the bot remembers the context of what you were just talking about.</p><p><strong>Replies are natural.</strong> Replying to a photo message to label it (“That’s Grandma Helen”) is exactly how you’d annotate something in a real conversation — no separate “edit metadata” screen.</p><p><strong>It’s already secure.</strong> Telegram’s encryption handles the connection between your phone and your Mac. You’re not opening any new security holes; you’re routing through a protocol millions of people already trust.</p><p><strong>Share it with family and friends.</strong> Create a Telegram group and add the Uhella bot to it. Everyone in the group can see the photos the bot shares — whether it’s responding to someone’s question or naturally surfacing a memory that fits the conversation (not like an ad; more like a friend who happens to remember that photo). When someone comments on a photo (“That’s Uncle Bob at the wedding!”), that context gets saved to the photo automatically. Your whole group helps build the memory together.</p><p>If someone in the group asks the bot a question directly, the bot replies that it needs your approval first. You’ll get a private prompt in your own DM with the bot — approve or deny without anyone else seeing. Once approved, that person can ask the bot for photos and questions just like you can.</p><p><strong>It’s private by design.</strong> Only the people you invite can chat with the bot. Anyone else who finds it gets no response.</p><p><strong>No app updates to manage.</strong> Telegram updates itself. Uhella’s intelligence lives on your Mac and improves when you teach it, not when you download something.</p><h3>Multiple Photo Libraries</h3><p>If you have more than one photo library on your Mac — many people do, without even thinking about it — Uhella finds them all automatically. No setup required.</p><p>A single click in the Uhella menu bar switches the bot to a different library. Your Telegram bot immediately starts searching that one instead. Switch back just as easily.</p><p>Each library is indexed independently, so descriptions and search history are kept separate.</p><h3>Getting Started</h3><p>Once Uhella is set up on your Mac, open Telegram and find your Uhella bot. Everything happens in that private chat — just type naturally.</p><p>Getting Started</p><p>Once Uhella is set up on your Mac, open Telegram and find your Uhella bot. Everything happens in that private chat — just type naturally.</p><h3>Searching Your Photos</h3><p>Type what you want to find. No special commands needed.</p><p>What you typeWhat happensTanzaniaShows photos from Tanzaniabirthday cake 2023Shows birthday photos from 2023sunset beachShows beach sunsetsmom and dadShows photos with your parentsold carShows vintage or classic cars</p><p>The bot understands context — dates, places, people, objects, moods. It reads the visual description of each photo, so it finds things even if they’re not in a filename or album.</p><p>Up to <strong>5 photos</strong> are shown at a time. If you want more, ask: <em>“show me more”</em> or <em>“any others?”</em></p><h3>Proactive Memories</h3><p>After <strong>5 minutes of silence</strong> in the chat, the bot will occasionally surface something interesting from your library on its own — a forgotten trip, a funny moment, something from years ago.</p><p>This happens only once per quiet period. As soon as you reply, the timer resets and the bot waits again.</p><h3>Teaching the Bot About Your Photos</h3><p>The bot learns from what you tell it. When you reply to a photo the bot sent, your words get attached to those photos — making future searches smarter.</p><h3>Adding context</h3><p>Reply directly to a bot photo message and describe what’s in it:</p><blockquote>“This is from our Kenya safari in 2019”</blockquote><blockquote>“That’s Grandma Helen at Christmas”</blockquote><blockquote>“Lake Tahoe — the summer we rented the cabin”</blockquote><p>The next time you search for “Kenya”, “Grandma Helen”, or “Lake Tahoe”, those photos will show up.</p><h3>Correcting a wrong description</h3><p>If the bot thinks something is in a photo but it isn’t, just say so:</p><blockquote>“No girl here”</blockquote><blockquote>“Not a beach”</blockquote><blockquote>“There is no dog”</blockquote><p>The bot removes that detail from the photo’s description. Future searches won’t pull up that photo for that term.</p><h3>Labeling the most recent search results</h3><p>You don’t have to quote a specific message. If you just type a label or correction after a search, it applies to the photos from that search:</p><ol><li>You search: <em>“sunset”</em> → bot shows 5 photos</li><li>You type: <em>“These are from Santorini 2018”</em></li><li>All 5 photos are now tagged with that context</li></ol><h3>Tips</h3><p><strong>Be specific when you can.</strong> “Red dress birthday party” finds photos faster than “party”.</p><p><strong>Names work well.</strong> If you’ve told the bot “That’s Grandma Helen”, searching “Helen” will find her photos.</p><p><strong>Corrections stick.</strong> Once you say “No dog” on a photo, it won’t appear in dog searches again.</p><p><strong>You can chat naturally.</strong> The bot handles full sentences, not just keywords. <em>“Do you have any photos from my trip to Japan?”</em> works just as well as <em>“Japan”</em>.</p><h3>What the Bot Cannot Do</h3><ul><li>It only sees <strong>your</strong> library on the Mac it’s installed on</li><li>It cannot edit, delete, or move your actual photos — it only reads them</li><li>It works best with photos that have been described (indexed). Newly added photos may take a few minutes to appear in search results</li><li>The chat is <strong>private</strong> — only the account configured as the owner can use it</li></ul><h3>Example Conversation</h3><pre>You:   Portugal trip<br>Bot:   [shows 5 photos from Lisbon 2022]</pre><pre>You:   [reply to one photo] This was the day we got lost in Alfama<br>Bot:   Got it, I&#39;ve noted that for these photos.</pre><pre>You:   any photos with the yellow tram?<br>Bot:   [shows photos with the Lisbon tram]</pre><pre>You:   [5 minutes pass with no messages]<br>Bot:   Browsing your library and found something worth sharing 📸<br>       [shows 3 photos from a hike in 2019]</pre><pre>You:   oh wow I forgot about that hike! which mountain was this?<br>Bot:   Based on the location data and the scenery, this looks like it could be<br>       in the Pacific Northwest — possibly near Mount Rainier...</pre><p><em>Uhella keeps everything local on your Mac. Your photos and conversations never leave your machine.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ad5890b3dfcb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Auto-launch all 3 Claude Sessions Exactly How You Had Them]]></title>
            <link>https://paulxiong.medium.com/how-to-auto-launch-all-3-claude-sessions-exactly-how-you-had-them-983d447b32f2?source=rss-76324cba9987------2</link>
            <guid isPermaLink="false">https://medium.com/p/983d447b32f2</guid>
            <category><![CDATA[claude]]></category>
            <category><![CDATA[sessions]]></category>
            <category><![CDATA[tmux]]></category>
            <dc:creator><![CDATA[Paul Xiong]]></dc:creator>
            <pubDate>Mon, 23 Mar 2026 21:06:11 GMT</pubDate>
            <atom:updated>2026-03-23T21:19:02.092Z</atom:updated>
            <content:encoded><![CDATA[<p>What you’re trying to do (restore 3 separate Claude CLI sessions after a reboot) unfortunately <strong>won’t work automatically</strong> just from renaming Warp/Terminal tabs. The tab names in <strong>Warp/Terminal</strong> are just labels — they don’t preserve the actual running processes or Claude state.</p><p>Here’s the <strong>clean, copy-paste setup</strong> using:</p><ul><li>tmux (session manager)</li><li>auto-start script</li><li>optional persistence</li></ul><h3>🚀 Step 1 — Install tmux (if not installed)</h3><pre>brew install tmux</pre><h3>📁 Step 2 — Create a startup script</h3><p>Create a file:</p><pre>nano ~/start-claude-sessions.sh</pre><p>Paste this:</p><pre>#!/bin/bash</pre><pre># Start a tmux session named &quot;claude-work&quot; if it doesn&#39;t exist<br>tmux has-session -t claude-work 2&gt;/dev/null</pre><pre>if [ $? != 0 ]; then<br>  # Create new session with first window<br>  tmux new-session -d -s claude-work -n backend<br>  tmux send-keys -t claude-work:backend &quot;claude --session backend&quot; C-m</pre><pre>  # Second window<br>  tmux new-window -t claude-work -n frontend<br>  tmux send-keys -t claude-work:frontend &quot;claude --session frontend&quot; C-m</pre><pre>  # Third window<br>  tmux new-window -t claude-work -n debugging<br>  tmux send-keys -t claude-work:debugging &quot;claude --session debugging&quot; C-m<br>fi</pre><pre># Attach to session<br>tmux attach -t claude-work</pre><p>Save and exit:</p><pre>CTRL + O<br>ENTER<br>CTRL + X</pre><h3>🔐 Step 3 — Make it executable</h3><pre>chmod +x ~/start-claude-sessions.sh</pre><h3>Step 4 — Run it</h3><pre>~/start-claude-sessions.sh</pre><p>Now you’ll get:</p><ul><li>1 tmux session</li><li>3 windows:</li><li>backend</li><li>frontend</li><li>debugging</li></ul><h3>🔁 Step 5 — Auto-start on terminal launch (optional)</h3><p>If you use <strong>Warp</strong>:</p><h3>Option A (simple)</h3><p>Add to your shell config:</p><pre>nano ~/.zshrc</pre><p>Add:</p><pre>~/start-claude-sessions.sh</pre><h3>Option B (better)</h3><p>Use Warp “Startup Commands”:</p><ul><li>Settings → Features → Startup</li><li>Add:</li></ul><pre>~/start-claude-sessions.sh</pre><h3>💾 Step 6 — Survive reboot (IMPORTANT)</h3><p>Install tmux plugins:</p><pre>brew install tmux-resurrect tmux-continuum</pre><p>Then add to ~/.tmux.conf:</p><pre>set -g @plugin &#39;tmux-plugins/tmux-resurrect&#39;<br>set -g @plugin &#39;tmux-plugins/tmux-continuum&#39;</pre><pre>set -g @continuum-restore &#39;on&#39;<br>set -g @continuum-save-interval &#39;5&#39;</pre><p>Then reload:</p><pre>tmux source-file ~/.tmux.conf</pre><h3>🎯 How you’ll use it daily</h3><h3>Start work:</h3><pre>~/start-claude-sessions.sh</pre><h3>Switch between sessions:</h3><pre>Ctrl + b → n   (next window)<br>Ctrl + b → p   (previous)</pre><h3>🧠 Pro tip (very useful)</h3><p>Give each session a purpose:</p><pre>claude --session backend<br>claude --session frontend<br>claude --session infra</pre><p>Claude will keep context per session (depending on CLI support).</p><p>Select previous sessions after run claude:/resume</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=983d447b32f2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Debugging iPhone → Backend → Ollama with mitmdump (Uhella)]]></title>
            <link>https://paulxiong.medium.com/debugging-iphone-backend-ollama-with-mitmdump-uhella-2985b52d8d70?source=rss-76324cba9987------2</link>
            <guid isPermaLink="false">https://medium.com/p/2985b52d8d70</guid>
            <category><![CDATA[ollama]]></category>
            <category><![CDATA[debugging]]></category>
            <category><![CDATA[mitmdump]]></category>
            <category><![CDATA[agents]]></category>
            <dc:creator><![CDATA[Paul Xiong]]></dc:creator>
            <pubDate>Wed, 18 Mar 2026 04:40:43 GMT</pubDate>
            <atom:updated>2026-03-18T04:40:43.107Z</atom:updated>
            <content:encoded><![CDATA[<p>This guide explains how to use the included helper script and mitmdump addon to record a chronological timeline of traffic flowing from an iPhone (Flutter app) to the backend and then to Ollama. It also summarizes the three reviewed scripts:</p><ul><li>scripts/debug_ollama_traffic.sh — orchestrator that starts Ollama, the backend (uvicorn) and two mitmdump reverse proxies.</li><li>scripts/mitmproxy_filter/timeline_logger.py — mitmdump addon that pretty-prints a chronological event timeline with truncated body context.</li><li>scripts/resign_tflite_dylibs.sh — utility to re-sign TFLite dylibs and the app bundle (not required for mitmdump; included for completeness).</li></ul><h3>Quick overview (what debug_ollama_traffic.sh sets up)</h3><p>Flow created by the script:</p><ul><li>Flutter app (on iPhone) → mitmdump A listening on :8765 → uvicorn backend on :8766</li><li>backend (uvicorn) → mitmdump B listening on :11435 → Ollama on :11434</li></ul><p>The script:</p><ul><li>Restarts Ollama with OLLAMA_MAX_LOADED_MODELS=1 (written to /tmp/ollama_debug.log).</li><li>Starts the backend (uvicorn) at :8766 and sets OLLAMA_HOST/OLLAMA_BASE_URL to point to the Ollama proxy (:11435).</li><li>Runs two mitmdump instances with the same addon (timeline_logger.py). mitmdump A runs in the background and mitmdump B runs in the foreground.</li><li>Logs uvicorn to ~/.uhella_backend/server.log.</li></ul><p>Paths and ports used by the script (defaults):</p><ul><li>BACKEND_PROXY_PORT = 8765 (listen for Flutter → backend)</li><li>BACKEND_REAL_PORT = 8766 (actual uvicorn backend)</li><li>OLLAMA_PROXY_PORT = 11435 (listen for backend → Ollama)</li><li>OLLAMA_PORT = 11434 (actual Ollama)</li></ul><p>Run the orchestrator:</p><pre># Prereq: mitmproxy installed<br>brew install mitmproxy</pre><pre>bash scripts/debug_ollama_traffic.sh</pre><p>Press Ctrl+C to stop. The foreground mitmdump process keeps the script alive.</p><h3>Prepare the iPhone/device</h3><ol><li>Make sure the iPhone and Mac are on the same network.</li><li>Install mitmproxy’s CA certificate on the iPhone: open http://mitm.it from the device (or browse to the Mac IP:8765 if reachable) and follow the install instructions.</li><li>After installing the profile, enable full trust in Settings -&gt; General -&gt; About -&gt; Certificate Trust Settings.</li><li>Set the Wi‑Fi HTTP proxy (Manual) on the iPhone to use your Mac’s IP and port 8765 (BACKEND_PROXY_PORT). This routes the Flutter app&#39;s backend requests through mitmdump A.</li></ol><p>Notes:</p><ul><li>If the app uses certificate pinning, mitmproxy cannot decrypt TLS traffic.</li><li>If your environment uses different ports, update the script or the device proxy accordingly.</li></ul><h3>How timeline_logger.py formats output</h3><p>The addon prints an interleaved chronological timeline of requests and responses. Example lines:</p><pre>12:34:01.123  →  Flutter→backend  POST /agent<br>                   {&quot;prompt&quot;: &quot;hello&quot;, &quot;top_k&quot;: 25, ...}<br>12:34:01.145  →  backend→Ollama   POST /api/chat<br>                   {&quot;model&quot;: &quot;qwen2.5:3b&quot;, &quot;messages&quot;: [...], ...}<br>12:34:08.321  ←  backend→Ollama   200  7.3kb  7176ms<br>                   {&quot;message&quot;: {&quot;role&quot;: &quot;assistant&quot;, &quot;content&quot;: &quot;...&quot;}}<br>12:34:08.334  ←  Flutter→backend  200  1.1kb  7211ms<br>                   {&quot;response&quot;: &quot;...&quot;}</pre><p>Legend:</p><ul><li>Timestamp: local time with millisecond precision.</li><li>Arrow → (request) and ← (response).</li><li>Label: Flutter→backend (cyan) or backend→Ollama (yellow). Labels are determined by port numbers in timeline_logger._label(); if ports differ the label will be host:port.</li><li>The request/response body is printed below, indented, with truncation:</li><li>Strings truncated to ~120 chars (_MAX_STR).</li><li>Only the last _MAX_LINES lines of formatted JSON are shown.</li><li>NDJSON (Ollama streaming) is parsed and printed as an array of JSON objects.</li><li>The addon ignores paths listed in _FILTERED_PATHS (by default /status).</li></ul><p>If you need more detail, edit timeline_logger.py to increase _MAX_STR or _MAX_LINES or remove truncation.</p><h3>Common troubleshooting steps</h3><ul><li>mitmdump not found: brew install mitmproxy.</li><li>Certificate errors on device: confirm mitmproxy CA installed and trusted (Settings -&gt; Certificate Trust Settings).</li><li>Ports in use: stop conflicting apps or change the script’s ports (search at top of debug_ollama_traffic.sh).</li><li>Uvicorn fails to start: check ~/.uhella_backend/server.log (the script prints last lines on startup failure).</li><li>Ollama fails to start: check /tmp/ollama_debug.log.</li><li>If you see placeholder asset IDs (e.g., &lt;tool asset id&gt;1) in timeline output: inspect the backend→Ollama POST /api/chat payload and the LLM assistant responses in the Ollama response; these placeholders generally originate from prompt examples or LLM-generated text and should be remedied by backend validation (see agent logs/tests).</li></ul><h3>Useful manual mitmdump commands (equivalent to what’s in the script)</h3><p>Flutter → backend proxy (background):</p><pre>mitmdump \<br>  --mode &quot;reverse:http://localhost:8766@8765&quot; \<br>  --set &quot;view_filter=!~u /status&quot; \<br>  -s scripts/mitmproxy_filter/timeline_logger.py -q &amp;</pre><p>Backend → Ollama proxy (foreground):</p><pre>mitmdump \<br>  --mode &quot;reverse:http://localhost:11434@11435&quot; \<br>  -s scripts/mitmproxy_filter/timeline_logger.py -q</pre><p>To save flows for later inspection (write to file):</p><pre>mitmdump --mode &quot;reverse:http://localhost:8766@8765&quot; -s scripts/mitmproxy_filter/timeline_logger.py -w /tmp/uhella-flows.mitm<br># later view with mitmweb -r /tmp/uhella-flows.mitm<br>mitmweb -r /tmp/uhella-flows.mitm</pre><h3>Quick notes on resign_tflite_dylibs.sh</h3><p>This is a robust re-signing utility used when bundling a macOS app that includes TFLite dynamic libraries. Key points:</p><ul><li>Usage: resign_tflite_dylibs.sh &lt;AppBundlePath&gt; [CodeSignIdentity]</li><li>It finds libtensorflowlite dylibs and re-signs them, signs all Mach-O binaries inside the app, and finally re-signs the outer bundle.</li><li>The script auto-selects a signing identity if none is provided and can auto-detect an entitlements file.</li><li>Not required for mitmdump debugging, but useful when packaging a build that needs valid signatures.</li></ul><h3>Summary / Best practices</h3><ul><li>Use bash scripts/debug_ollama_traffic.sh to get a turnkey timeline view.</li><li>Install and trust mitmproxy certificate on your iPhone before routing traffic.</li><li>If you need full request/response bodies, tweak _MAX_STR and _MAX_LINES in scripts/mitmproxy_filter/timeline_logger.py.</li><li>Save mitmdump flows with -w to review them later in mitmweb.</li></ul><p>If you’d like, I can:</p><ul><li>Add quick shell snippets to automate installing the mitmproxy certificate on the iPhone (notes only — certificate install must be done on-device).</li><li>Add a short troubleshooting checklist document for common issues (port conflicts, certificate pinning, app using HTTPS pinning).</li></ul><p>File created: scripts/mitmdump_debug_agent.md</p><p>Youtube video demo: <a href="https://www.youtube.com/watch?v=lWrLeukI2zo">https://www.youtube.com/watch?v=lWrLeukI2zo</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2985b52d8d70" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Taste: On-Device Personalization with a Transformer You Actually Own]]></title>
            <link>https://paulxiong.medium.com/taste-on-device-personalization-with-a-transformer-you-actually-own-f33395f0f709?source=rss-76324cba9987------2</link>
            <guid isPermaLink="false">https://medium.com/p/f33395f0f709</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[contrastive-learning]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[photos]]></category>
            <category><![CDATA[self-learning]]></category>
            <dc:creator><![CDATA[Paul Xiong]]></dc:creator>
            <pubDate>Sun, 15 Mar 2026 19:22:30 GMT</pubDate>
            <atom:updated>2026-03-15T19:22:30.551Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>A deep dive into building a personalized photo recommendation engine that trains on your iPhone, runs in milliseconds, and lets you share your aesthetic as a file.</blockquote><h3>The Problem with Recommendation Engines You Don’t Own</h3><p>Every major recommendation system today is a black box running on someone else’s server. It knows your behavior, but you can’t inspect it, reset it, export it, or give it to a friend. The model is the platform’s property — not yours.</p><p><strong>Taste</strong> inverts this. The model lives on your device. It trains on your taps. It’s a file you can export, share, import, and version. And it runs fast enough that every single like triggers a training step in real time.</p><p>This article walks through the full architecture: how the transformer is designed for on-device constraints, why “clicks-is-all-you-need” works as a training signal, how the feed switches between random exploration and AI exploitation like a reinforcement learning agent, and what makes taste-sharing a genuinely new primitive.</p><h3>Architecture Overview</h3><pre>User tap<br>    │<br>    ▼<br>TapTracker          ← records every liked photo (newest-first queue)<br>    │<br>    ▼<br>ExposureTracker     ← records every shown photo (skipped = implicit negative)<br>    │<br>    ├── Positive target: the tapped photo<br>    └── Negative samples: 12 recent skipped photos<br>    │<br>    ▼<br>Training Isolate    ← background Dart isolate, never blocks UI<br>    │<br>    ▼<br>TransformerModel    ← 256-dim on-device transformer, updates _outputProjection<br>    │<br>    ▼<br>ModelWeights DB     ← gzip-compressed int8/f32 hybrid, ~3-4 MB on disk<br>    │<br>    ├── Inference path → cosine similarity → self-score per photo<br>    └── Snapshot path  → export as .taste file, share with friends</pre><h3>The Transformer: Designed for Mobile Constraints</h3><h3>Dimension Reduction as the Core Trade-off</h3><p>The input to the system is a <strong>2048-dimensional ResNet50 feature vector</strong> for each photo. Running a full transformer at 2048 dimensions on a phone is impractical — the attention matrices alone would be 2048×2048×4 heads = 64M parameters just for one layer.</p><p>The solution is a <strong>bottleneck projection</strong>:</p><pre>Photo embeddings (2048-dim)<br>        │<br>        ▼  _inputProjection  [2048 × 256]<br>Internal representation (256-dim on iOS, 512-dim on Android)<br>        │<br>        ▼  Multi-head self-attention (4 heads)<br>        │<br>        ▼  Feed-forward network (2× hidden on iOS, 4× on Android)<br>        │<br>        ▼  _outputProjection  [256 × 2048]<br>Prediction (2048-dim, same space as input)</pre><p>This reduces the working memory from ~64MB to ~12MB uncompressed, and to ~3–4MB after quantization. The key insight is that you don’t need to do all your thinking at 2048 dimensions — you compress, reason, decompress.</p><h3>The Two Projection Matrices Are Not Symmetric</h3><p>_inputProjection and _outputProjection are not transposes of each other. They are learned independently:</p><ul><li>_inputProjection learns to extract the <strong>semantically useful dimensions</strong> from ResNet features</li><li>_outputProjection is the <strong>primary trained weight</strong> — it learns to map internal transformer output back into the specific region of embedding space that corresponds to what the user likes</li></ul><p>This asymmetry is intentional. In the normal training path (trainOnBatch), only _outputProjection is updated. The attention and FFN weights stay frozen. This is a deliberate design decision: the attention mechanism acts as a <strong>fixed feature extractor over the sequence</strong>, while the output projection is the learnable &quot;taste head&quot; that gets shaped by user behavior.</p><h3>Residual Connection: Staying in ImageNet Space</h3><p>The inference output applies a critical residual:</p><pre>final_output[i] = inputVector[i] + 0.5 * purePrediction[i]</pre><p>This means the model never predicts a completely arbitrary embedding. It always stays <strong>50% anchored to the input photo’s own embedding</strong>. The learned component (purePrediction) provides a <em>delta</em> — a push toward what you tend to like, from wherever the current photo sits in semantic space.</p><p>Why does this matter? ResNet50 embeddings are trained on ImageNet. They have a specific geometry — nearby points are semantically similar images. If the model were free to predict arbitrary 2048-dim vectors, it could escape this geometry entirely and produce predictions that don’t correspond to any real image concept. The residual prevents this, keeping every prediction interpretable within the original embedding space.</p><p>The training objective reflects this exactly:</p><pre>We want: input + 0.5 * purePrediction ≈ target<br>So train toward: purePrediction ≈ (target - input) / 0.5</pre><h3>Numerical Safety Everywhere</h3><p>On-device training without a server-side safety net requires explicit bounds at every step:</p><p>GuardValuePurposeWeight clamp±5.0Prevents weight explosion across many tapsError clamp±5.0Prevents single-step catastrophic updatesGradient clamp±1.0Bounds individual gradient valuesexp() input clamp±50.0Prevents NaN in softmaxtanh() input clamp±10.0Prevents saturation in GELU</p><h3>“Clicks-Is-All-You-Need”: The Training Philosophy</h3><h3>One Tap, One Training Step</h3><p>The entire training pipeline collapses to a single principle: <strong>every like is a supervised training example</strong>. No explicit labels, no manual annotation, no periodic batch jobs. The user’s tap <em>is</em> the label.</p><p>When a user taps photo <strong>T</strong> after having seen photos <strong>A, B, C</strong>:</p><ul><li><strong>Target embedding</strong>: ResNet50 embedding of photo T</li><li><strong>Input sequence</strong>: [C, B, A] (newest first, up to 10 photos)</li><li><strong>Negative samples</strong>: up to 12 photos the user scrolled past between taps (from ExposureTracker)</li></ul><p>The model is trained to answer: <em>“Given the sequence of photos I’ve liked, predict the embedding of the next photo I’ll like.”</em></p><h3>Why Skipped Photos Are Valuable</h3><p>The ExposureTracker maintains an in-memory queue of up to 400 photos the user has been shown. Photos between two taps — the ones the user saw but didn’t like — are <strong>implicit negatives</strong>. They’re not random noise; they’re photos from the user’s actual library that the user actively chose to skip.</p><p>This makes them <strong>hard negatives</strong>: photos that are potentially similar to liked content (they came from the same library, shown in the same session), but that the user explicitly passed over. Training against these produces a much sharper decision boundary than training against random images from the internet.</p><h3>Cosine Similarity as the Loss</h3><p>The loss function is simply:</p><pre>loss = 1.0 - cosine_similarity(prediction, target)</pre><p>Range: 0 (perfect) to 2 (opposite). This is a cosine loss in the normalized embedding space, which has a clean geometric interpretation: <strong>push the model’s output vector toward the target direction on the unit hypersphere</strong>.</p><p>The gradient targets a “pure prediction” computed from the residual relationship:</p><pre>desiredPure = (target - input) / 0.5</pre><p>Then error = desiredPure - currentPure, clipped to ±5.0, used to update _outputProjection via a rank-1 outer product update:</p><pre>ΔW[j,i] = error[i] × reducedPrediction[j] × scale</pre><p>where scale = lr / (||reducedPrediction|| × 10). The denominator normalizes the update by the activation magnitude, preventing large activations from causing proportionally large weight changes.</p><h3>Training in a Background Isolate</h3><p>Flutter’s Dart runtime is single-threaded per isolate. Running 50 epochs of matrix multiplication on the main thread would drop frames. The entire training pipeline runs in a <strong>dedicated background isolate</strong> — a separate Dart execution context with its own memory space.</p><p>Communication happens through typed message passing:</p><pre>Main Isolate                     Training Isolate<br>     │                                 │<br>     │─── TrainingMessage ────────────►│<br>     │    (targetAssetId,              │<br>     │     inputSequence,              │  trainOnBatch()<br>     │     negativeAssetIds)           │  _updateWeights()<br>     │                                 │  saveWeights()<br>     │◄── TrainingResult ─────────────│<br>     │    (weightUpdated, steps)       │<br>     │                                 │<br>     ▼                                 │<br>reloadWeights()                        │<br>invalidateCache()                      │<br>emitTasteUpdate()                      │</pre><p>The UI never waits for training. Training results arrive asynchronously and trigger a cache invalidation + recommendation refresh.</p><h3>Self-Score: How a Photo Knows If You’ll Like It</h3><h3>The Inference Path</h3><p>Given the user’s recent tap history, the model predicts an embedding vector representing “what I’d like to see next.” Self-score measures how close any given photo is to that prediction:</p><pre>1. Get tapped sequence: [photo_n, photo_{n-1}, ..., photo_{n-9}]<br>2. Run predict(sequence) → predicted_embedding (2048-dim)<br>3. For candidate photo C with embedding E_C:<br>   self_score = cosine_similarity(predicted_embedding, E_C)</pre><p>A self-score above 0.60 means the photo is likely to be recommended. Below 0.60, it stays in the random feed.</p><h3>Self-Score as a Live Feedback Signal</h3><p>The self-score is computed dynamically as the user’s context changes. After each like, the tap sequence updates, the model updates (via training), and self-scores across the entire photo library shift accordingly. This creates a <strong>real-time preference signal</strong> that can be visualized per photo.</p><p>This is qualitatively different from a static ranking. The score isn’t “the system thinks you’ll like this” — it’s “given your last 10 likes, the model predicts something this similar to this photo.”</p><h3>Random Feed vs. AI Feed: Reinforcement Learning in Disguise</h3><h3>Two Feeds, One Purpose</h3><p>The app maintains two feed modes:</p><ul><li><strong>Random feed</strong>: Photos sampled without regard to model predictions. Exploration.</li><li><strong>AI feed</strong>: Photos filtered by self-score ≥ 0.60, sorted by predicted similarity. Exploitation.</li></ul><p>This mirrors the classic <strong>explore/exploit dilemma</strong> from reinforcement learning.</p><h3>Why You Need Both</h3><p>A pure AI feed has a well-known failure mode: <strong>filter bubbles</strong>. The model learns from what the user has liked, then shows more of the same, which gets liked, making the model even narrower. You converge to a local optimum that may not be a global preference.</p><p>A pure random feed has the opposite problem: most photos are irrelevant, the user’s attention isn’t captured, and the system feels useless.</p><p>The two-feed architecture solves this by treating them as complementary:</p><pre>Random Feed                    AI Feed<br>─────────────                  ─────────────<br>&quot;Go far&quot;                       &quot;Go near&quot;<br>Exploration                    Exploitation<br>New discovery                  Preference reinforcement<br>Training signal diversity      Training signal density<br>Implicit negatives             High-value positives</pre><p>When the user browses the random feed and doesn’t tap → they’re <strong>defining boundaries</strong> (what they don’t like). When they browse the AI feed and tap → they’re <strong>reinforcing the center</strong> of their taste.</p><h3>The Switching Logic</h3><p>The system starts in random feed and switches to AI feed once the model is meaningfully trained:</p><pre>Conditions to switch to AI feed:<br>  trainingSteps &gt; 0              ← model has been trained at least once<br>  valid tap sequence exists      ← enough context for a prediction<br>  recommendations exist          ← at least one photo above 0.60 threshold<br>  ExposureTracker has negatives  ← enough skipped photos for contrast</pre><p>If the AI feed runs dry (no photos above threshold), it falls back to random feed automatically. This prevents the worst UX failure: showing the user nothing.</p><h3>The RL Framing</h3><p>Think of it this way:</p><p>RL ConceptIn This SystemAgentThe recommendation modelStateUser’s current tap sequenceActionShow this photo to the userRewardUser taps it (positive) or skips (negative)PolicyAI feed (exploitation of learned preferences)ExplorationRandom feed (discovers new preference regions)Value functionSelf-score (estimated probability of a tap)</p><p>The system doesn’t implement formal RL (no Q-learning, no policy gradient), but the two-feed structure captures the essential dynamics. The random feed explores the photo space, collects reward signals (taps and skips), and the AI feed exploits what’s been learned.</p><p>The key architectural choice that makes this work: <strong>every shown photo — including random feed photos — is tracked as a potential negative sample</strong>. The ExposureTracker doesn’t distinguish between AI feed and random feed exposures. Both contribute to defining taste.</p><h3>Taste as a Shareable File</h3><h3>The Model IS the Taste</h3><p>Because the entire personalization state lives in a ~3–4MB file (gzip-compressed int8/f32 hybrid weights), it becomes natural to treat taste as a transferable artifact:</p><pre>{<br>  &quot;snapshot_name&quot;: &quot;1234_3000&quot;,<br>  &quot;model_name&quot;: &quot;transformer&quot;,<br>  &quot;weights&quot;: &quot;&lt;base64_encoded_binary&gt;&quot;,<br>  &quot;weights_encoding&quot;: &quot;base64:int8_gzip&quot;,<br>  &quot;training_steps&quot;: 3000,<br>  &quot;pinned&quot;: 1<br>}</pre><p>Import this file → instantly browse through the lens of someone else’s aesthetic. Your feed reorganizes itself around their trained preferences.</p><h3>Snapshot Versioning</h3><p>The system maintains a full history of taste snapshots, named by a 4-digit code plus training step count (e.g., 1234_3000). You can:</p><ul><li><strong>Pin</strong> a favorite taste (doesn’t get overwritten by continued training)</li><li><strong>Switch</strong> between tastes instantly (just activate a different snapshot)</li><li><strong>Export</strong> any snapshot as a .taste file</li><li><strong>Import</strong> a friend’s taste and browse through their eyes</li></ul><p>This creates a fundamentally new social primitive: <strong>aesthetic sharing without social graphs</strong>. You’re not following a person — you’re temporarily inhabiting their trained model.</p><h3>What “3000 Training Steps” Means</h3><p>The training step counter (encoded in the snapshot name) gives a rough signal of how “mature” a taste is:</p><ul><li><strong>0 steps</strong>: Fresh model, random weights. Random feed dominates.</li><li><strong>50–200 steps</strong>: Early taste formation. AI feed starts appearing.</li><li><strong>1000+ steps</strong>: Stable aesthetic. High-confidence recommendations.</li><li><strong>5000+ steps</strong>: Highly specialized. Narrow but precise taste.</li></ul><p>You can use training steps to evaluate whether an imported taste has enough signal to be useful.</p><h3>Weight Serialization: Hybrid Quantization</h3><h3>Why Not Pure int8?</h3><p>The projection matrices (_inputProjection and _outputProjection) are the most sensitive weights in the model. They handle the 2048↔256 dimensional bridge. Quantizing them to int8 introduces rounding errors at the dimensional transition that compound across every inference.</p><p>The attention and FFN weights, operating entirely within the 256-dim space, are much more tolerant of quantization noise. Small errors in the attention scores produce small errors in the weighted average of values — the softmax and residual connections act as natural smoothing.</p><h3>The Hybrid Format</h3><pre>InputProjection:  float32  (2048 × 256 × 4 bytes = 2.1 MB)<br>OutputProjection: float32  (256 × 2048 × 4 bytes = 2.1 MB)<br>QueryWeights:     int8     (256 × 256 × 1 byte = 65 KB)<br>KeyWeights:       int8     (65 KB)<br>ValueWeights:     int8     (65 KB)<br>OutputWeights:    int8     (65 KB)<br>FFN1:             int8     (256 × 512 × 1 byte = 131 KB)<br>FFN2:             int8     (131 KB)</pre><pre>Before gzip:  ~4.7 MB<br>After gzip:   ~2-3 MB</pre><p>Per-tensor quantization uses each tensor’s own scale factor:</p><pre>scale = max_abs_value / 127.0<br>quantized = round(value / scale).clamp(-127, 127)</pre><p>This is significantly better than global quantization — a tensor whose values are all near 0.01 gets its own scale, rather than being swamped by the scale of a tensor with values near 5.0.</p><h3>Why This Design Is Unique</h3><h3>1. The Model Is Yours</h3><p>Centralized recommendation engines are trained on aggregate data from millions of users. Your signal is diluted by everyone else’s. The taste model is trained <strong>only on your taps, only on your device</strong>. No user’s behavior ever influences another user’s model.</p><h3>2. Instant Feedback Loop</h3><p>The training-to-inference loop closes in milliseconds. You like a photo → training fires in the background → within a few seconds, your feed has shifted. This is a tighter feedback loop than any server-side system (which typically has delays of hours or days for recommendation updates).</p><h3>3. Compositional Aesthetic Units</h3><p>Snapshots make taste <strong>compositional</strong>. You can train a taste on architectural photography, export it, then train a separate taste on food photography, and switch between them. Each snapshot is a distinct aesthetic filter over the same photo library.</p><h3>4. Privacy by Architecture</h3><p>There is no telemetry path. The model doesn’t communicate with any server. Training happens locally, weights stay local, and sharing is a deliberate act (you explicitly export and send the file). Privacy isn’t a policy — it’s a structural property.</p><h3>5. The RL Duality of Random and AI Feed</h3><p>Most recommendation systems have a single feed with an explore/exploit trade-off baked into a single ranked list. Separating them into two distinct modes makes the trade-off <strong>visible and controllable</strong>. The user doesn’t need to understand RL — they just know “this feed surprises me” vs “this feed knows me.”</p><h3>Limitations and Open Questions</h3><p><strong>Attention weights are frozen in normal training.</strong> Only _outputProjection is updated per tap. This means the attention mechanism — the part that could learn <em>how to combine</em> a sequence of liked photos — never specializes to the user. It remains at random initialization. This is an intentional trade-off (simpler training, fewer parameters to update), but it caps expressivity.</p><p><strong>Sequential context is shallow.</strong> The model sees 10 previous taps. This is enough for short-term preference within a session, but doesn’t capture longer-term aesthetic arcs (your taste in January vs. July).</p><p><strong>No cross-device sync.</strong> The model lives on the device where you trained it. Sharing between devices requires explicit snapshot export/import.</p><p><strong>iOS GPU training disabled.</strong> The native Metal/MPS path was designed to accelerate training but was disabled because the simplified linear model it implements is architecturally incompatible with the Dart transformer — updating projection weights via the wrong gradient degrades non-target photo scores. The correct fix (replicating full transformer in Metal) is complex enough to defer.</p><h3>Summary</h3><p>The taste system is a bet on a specific architectural thesis:</p><blockquote><strong>A small, on-device transformer, trained purely on user taps with implicit negative sampling, running in a two-mode feed that acts as an explore/exploit loop, produces a personalized recommendation engine that is private, fast, and exportable.</strong></blockquote><p>The pieces are individually well-known: transformers, cosine similarity search, RL-style exploration. What’s new is the combination — and specifically the decision to make the model a <strong>first-class artifact</strong> that the user owns, versions, and shares, rather than a side effect of platform telemetry.</p><p>The 3–4MB taste file is not just a model checkpoint. It’s a compressed representation of a person’s aesthetic, at a moment in time, portable enough to fit in a text message.</p><p><em>All code referenced in this article is from the on-device transformer implementation in </em><em>lib/helpers/transformer_model.dart, </em><em>lib/helpers/isolate_trainer.dart, and </em><em>lib/helpers/transformer_manager_with_isolate.dart.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f33395f0f709" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[An App Can Share Your Photo-Taste]]></title>
            <link>https://paulxiong.medium.com/an-app-can-share-your-photo-taste-5b1802cdaff7?source=rss-76324cba9987------2</link>
            <guid isPermaLink="false">https://medium.com/p/5b1802cdaff7</guid>
            <category><![CDATA[a-taste-for-life]]></category>
            <category><![CDATA[photo-taste]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[photos]]></category>
            <category><![CDATA[transformers]]></category>
            <dc:creator><![CDATA[Paul Xiong]]></dc:creator>
            <pubDate>Sun, 22 Feb 2026 02:35:27 GMT</pubDate>
            <atom:updated>2026-02-22T02:35:27.721Z</atom:updated>
            <content:encoded><![CDATA[<p>Welcome to <strong>Uhella</strong> — an AI-powered personal photo discovery app available on iOS and macOS. Think of it as a personalized, TikTok-style endless feed for your own photo collection. Its primary goal isn’t to be a rigid photo organizer, but rather to help you rediscover your memories through a uniquely tailored “AI Taste” that adapts to what captures your attention.</p><p><strong>1. Rediscover Lost Memories</strong> You likely have thousands of photos sitting on your phone that you haven’t viewed in ages. With Uhella, the app will automatically surface these forgotten moments. Rather than sorting rigidly by date, place, or event-or displaying them completely randomly-Uhella learns what you like and dislike. It feeds you photos dynamically, actively trying to surface the best of your entire collection.</p><p><strong>2. Share Your “Taste”, Not Your Photos</strong> In the non-AI era, we shared specific videos, photos, or text. Now, we can share our <em>Taste</em> (technically your unique “self-score” model). Because Uhella determines what photos are “good” based on your local interactions, you can share this profile with friends. When they load your Taste into their app, Uhella will rate their local photos based on <em>your</em> preferences. This allows you to compare aesthetics and “rate” each other’s hidden collections honestly and privately, without ever seeing or sharing the raw photos themselves.</p><p>When you launch the app, you dive straight into discovering your memories. The interface is purposefully minimal to let the photos shine.</p><p>For users who want to jump straight to making something beautiful, we offer the <strong>Quick Create</strong> workflow.</p><ul><li><strong>Streamlined Creation:</strong> Jump straight to generating videos or collages without navigating complex editing menus.</li><li><strong>Auto-Curated:</strong> The app groups chosen photos together behind the scenes, so you can focus entirely on the final product rather than manual sorting.</li><li><strong>Create Taste:</strong> You can also use Quick Create to intentionally train the AI on specific aesthetics or memories you want to see more of in your feed.</li></ul><p>Uhella’s most powerful feature is its <strong>Taste</strong>. Unlike standard timeline-based galleries, Uhella learns your preferences. The more you use the app, the better it becomes at surfacing photos you didn’t even know you were looking for-all processed entirely locally on your device!</p><p>Our Transformer-based AI relies solely on what you <strong>tap</strong> to shape your future feed. We call this the <em>“clicks-is-all-you-need”</em> approach. By simply interacting with the photos you love, you are curating a highly personalized, unique aesthetic feed.</p><p>Navigating between photos and pages is entirely gesture-based, matching intuitive, modern feed interfaces:</p><ul><li><strong>Home Page (AI Feed):</strong> Your personalized, endless vertical feed of recommended photos, shaped by your AI’s taste.</li><li><strong>Thumbnails Page:</strong> A sweeping grid overview of the photos found on your device.</li><li><strong>Photo Detail Page:</strong> For interacting with and exploring a specific photo in full-screen.</li><li>↕️ <strong>Swipe Up / Swipe Down:</strong> Scroll chronologically through your feed or the AI-recommended queue.</li><li>⬅️ <strong>Swipe Left / Swipe Right:</strong> Seamlessly transition between the full-screen <strong>Home Page (AI Feed)</strong> and the broad <strong>Thumbnails Page</strong>.</li><li>👆 <strong>Tap / Click:</strong> Engaging with a photo is the ultimate signal. Tapping tells the AI exactly what content you prefer to see next!</li></ul><p>From the main menu (and accessible via Quick Create), you can take action on your rediscovered memories:</p><ol><li><strong>Create Taste:</strong> Select multiple photos from your library and provide direct feedback (<strong>Love, Like, or Neutral</strong>) for each. The AI scans your entire library and uses these signals to fine-tune your unique AI Taste. You can even use the <strong>Crop Search</strong> feature to focus the AI on specific subjects within your training photos!</li><li><strong>Generate Video:</strong> Select a batch of images and the app will process and stitch them into a beautiful, shareable photo slideshow video.</li><li><strong>Generate Collage:</strong> Effortlessly group memories together into aesthetic grid-based collages.</li></ol><p>Enjoy exploring your past through a completely new lens!</p><p><a href="https://github.com/paulxiong/uhella"><em>Originally published at https://github.com.</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5b1802cdaff7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Readings: Yann LeCun’s World Model (reviewed with ChatGPT)-1]]></title>
            <link>https://paulxiong.medium.com/readings-yann-lecuns-world-model-reviewed-with-chatgpt-1-baab30a494f9?source=rss-76324cba9987------2</link>
            <guid isPermaLink="false">https://medium.com/p/baab30a494f9</guid>
            <category><![CDATA[self-learning]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[yan-lecun]]></category>
            <category><![CDATA[world-models]]></category>
            <dc:creator><![CDATA[Paul Xiong]]></dc:creator>
            <pubDate>Wed, 11 Feb 2026 16:24:29 GMT</pubDate>
            <atom:updated>2026-02-11T16:24:29.125Z</atom:updated>
            <content:encoded><![CDATA[<p>Good intelligence — human or artificial — depends on learning a hierarchy of representations where low levels capture detail and high levels capture meaning, enabling accurate prediction over multiple time scales.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Dd-HMNmjIhd-YSsCL2i6hQ.png" /></figure><h3>1. The core idea: prediction at different levels</h3><p>The key claim is:</p><blockquote><strong><em>Different levels of description are useful for predicting the future over different time horizons.</em></strong></blockquote><ul><li><strong>Lower levels</strong> → very detailed, good for <strong>short-term predictions</strong></li><li><strong>Higher levels</strong> → more abstract, good for <strong>long-term predictions</strong></li></ul><p>You <em>need all levels</em>, but for different purposes.</p><h3>2. Lower levels: detailed but short-sighted</h3><h3>What the slide says</h3><ul><li>Make <strong>short-range (short-term) predictions</strong></li><li><strong>Preserve details</strong></li><li>Are <strong>inaccurate or computationally difficult</strong> for long-range prediction</li></ul><h3>What this means</h3><p>Lower levels describe the system in terms of <strong>fine-grained components</strong> and precise physical states.</p><p>Examples from the diagram:</p><ul><li>Quantum fields</li><li>Particles</li><li>Atoms</li><li>Molecules</li></ul><h4>Why they’re limited:</h4><ul><li>They capture <em>everything</em>, including noise.</li><li>Small errors compound quickly.</li><li>Simulating them over long time spans becomes impossible.</li></ul><h4>Example</h4><ul><li>Predicting the exact position of every air molecule:</li><li>Accurate for milliseconds</li><li>Useless for predicting tomorrow’s weather</li><li>Predicting every atom in a protein:</li><li>Good for femtosecond dynamics</li><li>Terrible for predicting organism behavior</li></ul><p>👉 <strong>Too much detail hurts long-term prediction.</strong></p><h3>3. Higher levels: abstract but far-seeing</h3><h3>What the slide says</h3><ul><li>Make <strong>longer-range (long-term) predictions</strong></li><li>Representations contain <strong>less detail</strong></li><li>Can be <strong>accurate over long time horizons</strong>, but with fewer details</li></ul><h3>What this means</h3><p>Higher levels compress information into <strong>meaningful structures</strong> or <strong>patterns</strong>.</p><p>Examples from the diagram:</p><ul><li>Materials</li><li>Objects</li><li>Organisms</li><li>Individuals</li><li>Societies</li><li>Machines</li></ul><p>These descriptions ignore microscopic details and focus on <strong>stable, causal structure</strong>.</p><h4>Example</h4><ul><li>You don’t track atoms to predict:</li><li>A chair will support weight</li><li>A dog will run if startled</li><li>A society will experience economic trends</li></ul><p>👉 <strong>Abstraction removes noise and reveals long-term regularities.</strong></p><h3>4. Why the hierarchy matters (the arrows)</h3><p>The arrows in the diagram show <strong>emergence</strong>:</p><ul><li>Molecules → Materials</li><li>Proteins → Organelles → Cells → Organisms → Societies</li></ul><p>Each higher level:</p><ul><li>Is <strong>built from</strong> the lower level</li><li>Has <strong>new laws</strong> and regularities</li><li>Is <strong>not easily predictable</strong> by brute-force simulation of the lower level</li></ul><p>This is why:</p><ul><li>Biology is not just applied chemistry</li><li>Psychology is not just applied neuroscience</li><li>Sociology is not just applied biology</li></ul><p>Each level needs its <strong>own models</strong>.</p><h3>5. Connection to deep learning and AI</h3><p>This idea directly motivates <strong>deep neural networks</strong>:</p><ul><li>Lower layers:</li><li>Detect local, short-term patterns</li><li>Edges, textures, phonemes</li><li>Higher layers:</li><li>Capture abstract concepts</li><li>Objects, meaning, intent, goals</li></ul><p>Just like physics → biology → society, neural networks <strong>stack representations</strong> so that:</p><ul><li>Lower layers handle detail</li><li>Higher layers handle semantics and long-range structure</li></ul><h3>6. A simple intuition</h3><p>Think of predicting a chess game:</p><ul><li><strong>Atomic level</strong>: electron positions in the board<br> → impossible, useless</li><li><strong>Piece level</strong>: legal moves<br> → useful short-term</li><li><strong>Strategy level</strong>: “king safety”, “center control”<br> → useful long-term</li></ul><p>The <em>best</em> predictions come from the <strong>right level of abstraction</strong>, not the most detailed one.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=baab30a494f9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Claude Sonnet 4.5 Is Still the Best in My Case]]></title>
            <link>https://paulxiong.medium.com/claude-sonnet-4-5-is-still-the-best-in-my-case-419ac2c4e058?source=rss-76324cba9987------2</link>
            <guid isPermaLink="false">https://medium.com/p/419ac2c4e058</guid>
            <category><![CDATA[personality-model]]></category>
            <category><![CDATA[claude-code]]></category>
            <category><![CDATA[uhella]]></category>
            <category><![CDATA[claude-sonnet]]></category>
            <category><![CDATA[ai-taste]]></category>
            <dc:creator><![CDATA[Paul Xiong]]></dc:creator>
            <pubDate>Tue, 10 Feb 2026 06:59:12 GMT</pubDate>
            <atom:updated>2026-02-10T06:59:12.776Z</atom:updated>
            <content:encoded><![CDATA[<p>Using a simple but real production codebase, Claude Sonnet 4.5 still proved to be the best option.</p><p>My app trains my “Taste” by learning from how I tap on photos. With a fresh installation, the app requires at least two photos to begin training. Tooltips appear in the top-right corner to guide the user through the process:</p><ol><li>Initially: <strong>“Tap 2 photos to build your Taste.”</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ER2RkjIWIQRFMXvBPV_35g.png" /></figure><p>2. After one tap: <strong>“Tap 1 more photo to build your Taste.”</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ayB2KWTzmR079sxj2kU5LQ.png" /></figure><p>3. After two taps: the tooltip displays an emoji with a score.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hXXRYEi8Tgp5KlotIXFUYQ.png" /></figure><p>However, my code contained a bug: step 2 was always skipped. After the first tap, the app jumped directly to step 3.</p><p>I tried GPT-5, GPT-5.1, GPT-5.2, Gemini, and others — none of them were able to resolve the issue. Only Claude Sonnet 4.5 managed to identify and fix the problem, and it did so just once.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1VodT_JqooVYvXuzAB1AKg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=419ac2c4e058" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>