<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Alex Reed</title>
    <description>The latest articles on DEV Community by Alex Reed (@dailyfootballgames).</description>
    <link>https://dev.to/dailyfootballgames</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4267959%2F6898cb75-b315-42bf-ae51-72952c31d23f.png</url>
      <title>DEV Community: Alex Reed</title>
      <link>https://dev.to/dailyfootballgames</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dailyfootballgames"/>
    <language>en</language>
    <item>
      <title>Scoring "rare" answers in a daily trivia game with a softmax over Wikipedia signals</title>
      <dc:creator>Alex Reed</dc:creator>
      <pubDate>Fri, 27 Nov 2026 02:35:18 +0000</pubDate>
      <link>https://dev.to/dailyfootballgames/scoring-rare-answers-in-a-daily-trivia-game-with-a-softmax-over-wikipedia-signals-2dbe</link>
      <guid>https://dev.to/dailyfootballgames/scoring-rare-answers-in-a-daily-trivia-game-with-a-softmax-over-wikipedia-signals-2dbe</guid>
      <description>&lt;p&gt;I run a daily football trivia game where the goal is not just a right answer but a rare one. "Name a Chelsea player": the first names everyone thinks of are right but worth 10 points. A name hardly anyone else would think of is worth 100.&lt;/p&gt;

&lt;p&gt;So the whole game depends on one number per answer: how likely is a player to name him? Here is how that number is built, and the mistakes along the way.&lt;/p&gt;

&lt;h2&gt;
  
  
  First version: count real answers
&lt;/h2&gt;

&lt;p&gt;The obvious approach is to score each name by how often people actually type it. It falls apart on day one. With a few dozen answers per question, one person naming an obscure player pushes him ahead of legends nobody happened to type yet.&lt;/p&gt;

&lt;p&gt;I needed a prior: a guess at how famous each player is before anyone answers.&lt;/p&gt;

&lt;h2&gt;
  
  
  A softmax over public signals
&lt;/h2&gt;

&lt;p&gt;For each question, every right answer gets a probability:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;p_i = exp(w · x_i) / Σ_j exp(w · x_j)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The features &lt;code&gt;x_i&lt;/code&gt; all come from public Wikipedia and Wikidata data:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;page views of the player's article (log)&lt;/li&gt;
&lt;li&gt;how many language editions have an article about him (log)&lt;/li&gt;
&lt;li&gt;years with the team in question (log)&lt;/li&gt;
&lt;li&gt;clicks from the team's article to the player's, from the Wikimedia clickstream dump (log)&lt;/li&gt;
&lt;li&gt;whether he played there in the last five seasons&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The weights &lt;code&gt;w&lt;/code&gt; are fitted by maximum likelihood on real answers. On the first fit, standardised, page views came out at 1.12, language editions 0.98, years with the team 0.36, clickstream 0.16 and recent seasons 0.16. Fame beats tenure by a lot.&lt;/p&gt;

&lt;p&gt;Real answers then blend in on top, with a strong prior (K = 300). With K = 30, the old bug came back.&lt;/p&gt;

&lt;h2&gt;
  
  
  A guard for the obvious names
&lt;/h2&gt;

&lt;p&gt;The model alone still let some household names score high on some questions. So there is a hard rule: a question's most familiar answers by the model never score above the second tier (top 5%) or the third (top 12%). A hand-picked list of 20 obvious names across 9 popular questions is a test case: none of them may ever reach 75 points.&lt;/p&gt;

&lt;h2&gt;
  
  
  Did it work?
&lt;/h2&gt;

&lt;p&gt;Backtest on 448 real answers to 142 questions. Each answer is scored only from the other answers to its question, and the model is fitted on four fifths of the questions and tested on the rest. The target share per tier is 25 / 25 / 20 / 18 / 12.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Distance from target (L1)&lt;/th&gt;
&lt;th&gt;Obvious names at 75+ (of 180)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Before: rough estimate, K = 30, no guard&lt;/td&gt;
&lt;td&gt;36.0&lt;/td&gt;
&lt;td&gt;96&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;After: model, K = 300, guard&lt;/td&gt;
&lt;td&gt;24.8&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The cost shows up in the second-rarest tier: it gets 5.6% of answers instead of 18%. Most people name familiar players, and the guard keeps those down. Loosening it would fill that tier, but it would also let a name like Ivanović (Chelsea, ranked 134 of 1,193 by the model) score 75. I'd rather the rare tier feel earned.&lt;/p&gt;

&lt;h2&gt;
  
  
  Refitting every night, carefully
&lt;/h2&gt;

&lt;p&gt;A Cloudflare Worker cron refits the weights at 23:30 UTC on every answer so far, warm-started from the current weights, and stores the result for the next day. The new fit is thrown away, and yesterday's kept, if:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;there are fewer than 200 answers,&lt;/li&gt;
&lt;li&gt;it does more than 3 points worse on a fixed fifth of the questions, or&lt;/li&gt;
&lt;li&gt;any of the obvious names would score 75+.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It takes about half a second of CPU at 455 answers. A synthetic run at 20,000 answers takes about 2.5 s.&lt;/p&gt;

&lt;h2&gt;
  
  
  Same answer, same day, same score
&lt;/h2&gt;

&lt;p&gt;The last rule came from players, not data: if two people name the same player on the same day, they must get the same points. So the first request for a question each day freezes its score table from answers up to the day before. Today's answers only count from tomorrow.&lt;/p&gt;

&lt;p&gt;The game is at &lt;a href="https://footballkrillion.org/" rel="noopener noreferrer"&gt;footballkrillion.org&lt;/a&gt; if you want to see how rare your answers are.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>python</category>
      <category>datascience</category>
      <category>gamedev</category>
    </item>
  </channel>
</rss>
