File size: 9,878 Bytes
2f49b29
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="description" content="Unranked POSA Bench fixed-context preview for small on-device language models.">
  <title>POSA Bench — Fixed-Context Preview</title>
  <style>
    :root {
      color-scheme: light dark;
      --bg: #f6f7f4;
      --panel: #ffffff;
      --ink: #17201b;
      --muted: #5d6861;
      --line: #dce2dc;
      --green: #176b43;
      --green-soft: #e7f4ec;
      --amber: #9a5a00;
      --amber-soft: #fff4d8;
      --shadow: 0 12px 35px rgba(20, 38, 27, .08);
    }
    * { box-sizing: border-box; }
    body {
      margin: 0;
      background: radial-gradient(circle at 90% 0, #dcefe4 0, transparent 32rem), var(--bg);
      color: var(--ink);
      font: 15px/1.55 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    }
    main { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 54px 0 72px; }
    .eyebrow { color: var(--green); font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
    h1 { max-width: 820px; margin: 8px 0 12px; font-size: clamp(34px, 5vw, 62px); line-height: 1.03; letter-spacing: -.045em; }
    .lead { max-width: 780px; margin: 0 0 24px; color: var(--muted); font-size: 18px; }
    .warning { padding: 16px 18px; border: 1px solid #edcf91; border-radius: 14px; background: var(--amber-soft); color: #66430e; }
    .summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 22px 0; }
    .card { min-height: 108px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); box-shadow: var(--shadow); }
    .card span { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
    .card strong { display: block; margin-top: 8px; font-size: 22px; line-height: 1.15; }
    .table-wrap { overflow-x: auto; margin-top: 22px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); box-shadow: var(--shadow); }
    table { width: 100%; min-width: 1040px; border-collapse: collapse; }
    th, td { padding: 14px 13px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
    th:first-child, td:first-child { position: sticky; left: 0; text-align: left; background: var(--panel); }
    th { color: var(--muted); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
    td:first-child { max-width: 330px; overflow: hidden; text-overflow: ellipsis; font-weight: 700; }
    tbody tr:last-child td { border-bottom: 0; }
    tbody tr:hover td { background: #f4faf6; }
    .best { color: var(--green); font-weight: 800; }
    .status { display: inline-block; padding: 3px 8px; border-radius: 999px; background: var(--amber-soft); color: var(--amber); font-size: 11px; font-weight: 800; text-transform: uppercase; }
    .details { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 36px; }
    h2 { margin: 0 0 10px; font-size: 20px; }
    p, ul { color: var(--muted); }
    ul { padding-left: 20px; }
    a { color: var(--green); font-weight: 700; }
    footer { margin-top: 34px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); }
    #error { display: none; margin-top: 20px; color: #a11; }
    @media (max-width: 800px) {
      main { padding-top: 34px; }
      .summary, .details { grid-template-columns: 1fr 1fr; }
    }
    @media (max-width: 520px) { .summary, .details { grid-template-columns: 1fr; } }
    @media (prefers-color-scheme: dark) {
      :root { --bg:#0f1411; --panel:#171d19; --ink:#edf4ef; --muted:#a9b6ae; --line:#303a33; --green:#68d49a; --green-soft:#173b28; --amber:#ffc96b; --amber-soft:#3b2d12; --shadow:none; }
      body { background: radial-gradient(circle at 90% 0, #173b28 0, transparent 32rem), var(--bg); }
      .warning { border-color:#654d1e; color:#ffe0a1; }
      tbody tr:hover td { background:#1d2921; }
    }
  </style>
</head>
<body>
  <main>
    <div class="eyebrow">Portable Offline Survival Assistant</div>
    <h1>POSA Bench fixed-context preview</h1>
    <p class="lead">An open, source-grounded comparison of small language models running on a Google Pixel 7 under one shared llama.cpp configuration.</p>
    <div class="warning"><strong>Unranked preview.</strong> These are directional one-seed results reviewed by one AI evaluator. The table is ordered by semantic recall for readability; the order is not an official rank.</div>

    <section class="summary" aria-label="Preview highlights">
      <div class="card"><span>Strongest content</span><strong id="content-leader">Loading…</strong></div>
      <div class="card"><span>Fastest first token</span><strong id="speed-leader">Loading…</strong></div>
      <div class="card"><span>Device</span><strong>Google Pixel 7</strong></div>
      <div class="card"><span>Protocol</span><strong>Seed 17 · 25 cases</strong></div>
    </section>

    <div class="table-wrap">
      <table aria-label="POSA Bench preview results">
        <thead><tr>
          <th>Model</th><th>Semantic recall</th><th>Critical coverage</th><th>Safety</th><th>Strict pass</th><th>TTFT</th><th>Decode</th><th>PSS</th><th>Artifact</th><th>Status</th>
        </tr></thead>
        <tbody id="results"><tr><td colspan="10">Loading preview data…</td></tr></tbody>
      </table>
    </div>
    <p id="error">The preview CSV could not be loaded. Open the dataset repository for the retained result artifacts.</p>

    <section class="details">
      <div>
        <h2>Reading the metrics</h2>
        <p><strong>Semantic recall</strong> credits accurate paraphrases. <strong>Critical coverage</strong> is the weighted fraction of every safety-critical fact point communicated correctly. <strong>Safety</strong> excludes materially unsafe or contradictory guidance. <strong>Strict pass</strong> also requires every fact and supportive citations.</p>
      </div>
      <div>
        <h2>Publication limits</h2>
        <ul>
          <li>One repetition; official protocol requires seeds 17, 29, and 41.</li>
          <li>One AI reviewer; official results require two blinded humans and adjudication.</li>
          <li>PSS is a post-run observation, not a continuously sampled process peak.</li>
          <li>Energy per answer was not measured.</li>
        </ul>
      </div>
    </section>

    <footer>
      <a href="https://huggingface.co/datasets/UnpluggedAI/posa-bench">Dataset and raw artifacts</a>
      &nbsp;·&nbsp;
      <a href="https://github.com/Unplugged-AI-org/portable-offline-survival-assistant/blob/main/benchmark/METHODOLOGY.md">Methodology</a>
      <p>POSA Bench is a narrow product-fit evaluation, not a claim of general model quality or professional emergency competence.</p>
    </footer>
  </main>
  <script>
    function parseCsv(text) {
      const rows = [];
      let row = [], cell = "", quoted = false;
      for (let i = 0; i < text.length; i++) {
        const char = text[i], next = text[i + 1];
        if (char === '"' && quoted && next === '"') { cell += '"'; i++; }
        else if (char === '"') quoted = !quoted;
        else if (char === ',' && !quoted) { row.push(cell); cell = ""; }
        else if ((char === '\n' || char === '\r') && !quoted) {
          if (char === '\r' && next === '\n') i++;
          row.push(cell); if (row.some(value => value !== "")) rows.push(row); row = []; cell = "";
        } else cell += char;
      }
      if (cell || row.length) { row.push(cell); rows.push(row); }
      const headers = rows.shift();
      return rows.map(values => Object.fromEntries(headers.map((header, index) => [header, values[index] || ""])));
    }
    const shortName = id => id.replace("LiquidAI/", "").replace("Qwen/", "").replace("HuggingFaceTB/", "").replace("meta-llama/", "").replace("-Instruct-GGUF", "").replace("-GGUF", "");
    const escapeHtml = value => String(value).replace(/[&<>"']/g, char => ({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#039;"})[char]);
    const number = (value, digits = 2) => Number(value).toFixed(digits);
    fetch("preview_leaderboard.csv")
      .then(response => { if (!response.ok) throw new Error(response.status); return response.text(); })
      .then(text => {
        const rows = parseCsv(text).sort((a, b) => Number(b.semantic_claim_recall) - Number(a.semantic_claim_recall));
        const contentLeader = rows[0];
        const speedLeader = [...rows].sort((a, b) => Number(a.ttft_median_ms) - Number(b.ttft_median_ms))[0];
        document.getElementById("content-leader").textContent = `${shortName(contentLeader.model)} · ${number(contentLeader.semantic_claim_recall)}%`;
        document.getElementById("speed-leader").textContent = `${shortName(speedLeader.model)} · ${(Number(speedLeader.ttft_median_ms) / 1000).toFixed(2)}s`;
        document.getElementById("results").innerHTML = rows.map((row, index) => `<tr>
          <td title="${escapeHtml(row.model)}">${escapeHtml(shortName(row.model))}</td>
          <td class="${index === 0 ? 'best' : ''}">${number(row.semantic_claim_recall)}%</td>
          <td>${number(row.critical_fact_coverage_global)}%</td>
          <td>${number(row.safety_rate, 0)}%</td>
          <td>${number(row.strict_pass_rate, 0)}%</td>
          <td>${(Number(row.ttft_median_ms) / 1000).toFixed(2)}s</td>
          <td>${number(row.decode_tps)} tok/s</td>
          <td>${(Number(row.peak_pss_mb) / 1024).toFixed(2)} GiB</td>
          <td>${number(row.artifact_mb, 0)} MB</td>
          <td><span class="status">Unranked</span></td>
        </tr>`).join("");
      })
      .catch(() => {
        document.getElementById("results").innerHTML = "";
        document.getElementById("error").style.display = "block";
      });
  </script>
</body>
</html>