<?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:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"><channel><title><![CDATA[Filip Dimitrovski]]></title><description><![CDATA[Computer science, data science/ML and startups. Written by Filip Dimitrovski.]]></description><link>https://www.fikisipi.com</link><image><url>https://substackcdn.com/image/fetch/$s_!Nkye!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8941f301-a7f6-4f39-8cb6-3a3bf2ca0a0c_334x334.png</url><title>Filip Dimitrovski</title><link>https://www.fikisipi.com</link></image><generator>Substack</generator><lastBuildDate>Wed, 15 Apr 2026 03:41:53 GMT</lastBuildDate><atom:link href="https://www.fikisipi.com/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Filip Dimitrovski]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[fikisipi@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[fikisipi@substack.com]]></itunes:email><itunes:name><![CDATA[Filip Dimitrovski]]></itunes:name></itunes:owner><itunes:author><![CDATA[Filip Dimitrovski]]></itunes:author><googleplay:owner><![CDATA[fikisipi@substack.com]]></googleplay:owner><googleplay:email><![CDATA[fikisipi@substack.com]]></googleplay:email><googleplay:author><![CDATA[Filip Dimitrovski]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[The Error Correction Zoo and Google's quantum chip Willow]]></title><description><![CDATA[Google announced Willow, its 105-qubit quantum chip:]]></description><link>https://www.fikisipi.com/p/the-error-correction-zoo-and-googles</link><guid isPermaLink="false">https://www.fikisipi.com/p/the-error-correction-zoo-and-googles</guid><dc:creator><![CDATA[Filip Dimitrovski]]></dc:creator><pubDate>Tue, 10 Dec 2024 22:35:06 GMT</pubDate><enclosure url="https://substackcdn.com/image/youtube/w_728,c_limit/l_KrC1mzd0g" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Google announced Willow, its 105-qubit quantum chip: </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!7WBA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5f2353f-639c-46be-be82-8fef5a35bb68_1174x434.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!7WBA!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5f2353f-639c-46be-be82-8fef5a35bb68_1174x434.png 424w, https://substackcdn.com/image/fetch/$s_!7WBA!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5f2353f-639c-46be-be82-8fef5a35bb68_1174x434.png 848w, https://substackcdn.com/image/fetch/$s_!7WBA!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5f2353f-639c-46be-be82-8fef5a35bb68_1174x434.png 1272w, https://substackcdn.com/image/fetch/$s_!7WBA!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5f2353f-639c-46be-be82-8fef5a35bb68_1174x434.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!7WBA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5f2353f-639c-46be-be82-8fef5a35bb68_1174x434.png" width="1174" height="434" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e5f2353f-639c-46be-be82-8fef5a35bb68_1174x434.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:434,&quot;width&quot;:1174,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:124303,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!7WBA!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5f2353f-639c-46be-be82-8fef5a35bb68_1174x434.png 424w, https://substackcdn.com/image/fetch/$s_!7WBA!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5f2353f-639c-46be-be82-8fef5a35bb68_1174x434.png 848w, https://substackcdn.com/image/fetch/$s_!7WBA!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5f2353f-639c-46be-be82-8fef5a35bb68_1174x434.png 1272w, https://substackcdn.com/image/fetch/$s_!7WBA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5f2353f-639c-46be-be82-8fef5a35bb68_1174x434.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div id="youtube2-l_KrC1mzd0g" class="youtube-wrap" data-attrs="{&quot;videoId&quot;:&quot;l_KrC1mzd0g&quot;,&quot;startTime&quot;:null,&quot;endTime&quot;:null}" data-component-name="Youtube2ToDOM"><div class="youtube-inner"><iframe src="https://www.youtube-nocookie.com/embed/l_KrC1mzd0g?rel=0&amp;autoplay=0&amp;showinfo=0&amp;enablejsapi=0" frameborder="0" loading="lazy" gesture="media" allow="autoplay; fullscreen" allowautoplay="true" allowfullscreen="true" width="728" height="409"></iframe></div></div><p>Based on what I&#8217;ve read from <a href="https://scottaaronson.blog/?p=8525">Aaronson&#8217;s blog, the arxiv preprint</a> that describes what Willow is, dates from a few months ago. </p><p>The release is mostly a naming thing and the theoretical progress comes from the error correction from the link. I assume it&#8217;s hard to assess Willow&#8217;s practical value <em>in daily life</em> without offending the people building it while being intellectually honest to laymen.</p><p>What can be said from what I&#8217;ve seen is that the timeline of QC progress is steady and that Willow (like it&#8217;s predecessor, Sycamore) can run some operations (not as simple as like addition or substraction, closer to &#8220;is this gigantic file of random numbers produced by a natural coin flip or a fake one?&#8221;) that your gaming PC can&#8217;t in many years &#128522; </p><p><strong>I&#8217;m by no means a QC expert</strong>, just a habitual reader of LessWrong-related blogs (and I blog myself to improve my knowledge and store it for later use) and my concept of a QC in the real world would look like a &#8220;boring&#8221; lab circa the year 2040 where a pharmaceutical company gets a contract to develop a patent for a pharmaceutical and uses a quantum computer. It&#8217;s not as sexy as Richard Feynman describes it.</p><p>The obsessive part of my brain noticed something new that&#8217;s related to quantum computers: the error correction zoo &#8212; which is beginning to get some maintenance work in this month!</p><p>It&#8217;s available on <a href="https://errorcorrectionzoo.org/">https://errorcorrectionzoo.org/</a> and editable on <a href="https://github.com/errorcorrectionzoo/eczoo_data/">https://github.com/errorcorrectionzoo/eczoo_data/</a>:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!6CX4!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01b7af0c-97cc-48fd-8cbf-bb749946f68f_1254x552.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!6CX4!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01b7af0c-97cc-48fd-8cbf-bb749946f68f_1254x552.png 424w, https://substackcdn.com/image/fetch/$s_!6CX4!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01b7af0c-97cc-48fd-8cbf-bb749946f68f_1254x552.png 848w, https://substackcdn.com/image/fetch/$s_!6CX4!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01b7af0c-97cc-48fd-8cbf-bb749946f68f_1254x552.png 1272w, https://substackcdn.com/image/fetch/$s_!6CX4!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01b7af0c-97cc-48fd-8cbf-bb749946f68f_1254x552.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!6CX4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01b7af0c-97cc-48fd-8cbf-bb749946f68f_1254x552.png" width="1254" height="552" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/01b7af0c-97cc-48fd-8cbf-bb749946f68f_1254x552.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:552,&quot;width&quot;:1254,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:280106,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!6CX4!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01b7af0c-97cc-48fd-8cbf-bb749946f68f_1254x552.png 424w, https://substackcdn.com/image/fetch/$s_!6CX4!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01b7af0c-97cc-48fd-8cbf-bb749946f68f_1254x552.png 848w, https://substackcdn.com/image/fetch/$s_!6CX4!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01b7af0c-97cc-48fd-8cbf-bb749946f68f_1254x552.png 1272w, https://substackcdn.com/image/fetch/$s_!6CX4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01b7af0c-97cc-48fd-8cbf-bb749946f68f_1254x552.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">If you use any computer, your usual classic one, or a quantum one, the data occasionally gets corrupt. The job of error correcting codes is to add extra information so that even if something bad happens</figcaption></figure></div><p>From what I&#8217;ve seen professors and researchers don&#8217;t remember things like specific details for an ECC in practice because there&#8217;s no incentive to (unless they are teaching/using them in that particular time). You can think of the online zoo as an informal encyclopedia of ways to correct errors in messages.</p><p>Analogous to how veterinarians take care of animals in normal zoos, the &#8220;vets&#8221; of the error correction zoo take care of all the error-correcting codes.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!W4Is!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56411d5a-6173-4cb9-94d5-43d80e1523db_1312x320.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!W4Is!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56411d5a-6173-4cb9-94d5-43d80e1523db_1312x320.png 424w, https://substackcdn.com/image/fetch/$s_!W4Is!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56411d5a-6173-4cb9-94d5-43d80e1523db_1312x320.png 848w, https://substackcdn.com/image/fetch/$s_!W4Is!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56411d5a-6173-4cb9-94d5-43d80e1523db_1312x320.png 1272w, https://substackcdn.com/image/fetch/$s_!W4Is!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56411d5a-6173-4cb9-94d5-43d80e1523db_1312x320.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!W4Is!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56411d5a-6173-4cb9-94d5-43d80e1523db_1312x320.png" width="1312" height="320" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/56411d5a-6173-4cb9-94d5-43d80e1523db_1312x320.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:320,&quot;width&quot;:1312,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:104884,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!W4Is!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56411d5a-6173-4cb9-94d5-43d80e1523db_1312x320.png 424w, https://substackcdn.com/image/fetch/$s_!W4Is!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56411d5a-6173-4cb9-94d5-43d80e1523db_1312x320.png 848w, https://substackcdn.com/image/fetch/$s_!W4Is!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56411d5a-6173-4cb9-94d5-43d80e1523db_1312x320.png 1272w, https://substackcdn.com/image/fetch/$s_!W4Is!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56411d5a-6173-4cb9-94d5-43d80e1523db_1312x320.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>What makes the zoo interesting, and related to why quantum computers don&#8217;t work well in practice yet, is that error correction (at scale) is still an unsolved challenge for quantum computing. Creating a classical bit is easy: anything that can store true/false over time is good.</p><p>Creating a qubit, is, well harder, but not impossible &#8212; think of any quantum phenomenon from HS physics intro like light polarization and you can represent a quantum state &#8212; that&#8217;s a physical qubit. But, nature loves to fiddle with quantum states and break them via noise &#8212; so your physical qubit isn&#8217;t reliable. And we have to find ways to fix them. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://www.smbc-comics.com/comic/the-talk-3https://www.smbc-comics.com/comic/the-talk-3" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ZuXB!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe08b91f0-2f2c-46be-baae-495c934b05dc_1110x1022.png 424w, https://substackcdn.com/image/fetch/$s_!ZuXB!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe08b91f0-2f2c-46be-baae-495c934b05dc_1110x1022.png 848w, https://substackcdn.com/image/fetch/$s_!ZuXB!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe08b91f0-2f2c-46be-baae-495c934b05dc_1110x1022.png 1272w, https://substackcdn.com/image/fetch/$s_!ZuXB!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe08b91f0-2f2c-46be-baae-495c934b05dc_1110x1022.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ZuXB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe08b91f0-2f2c-46be-baae-495c934b05dc_1110x1022.png" width="1110" height="1022" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e08b91f0-2f2c-46be-baae-495c934b05dc_1110x1022.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1022,&quot;width&quot;:1110,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:599112,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://www.smbc-comics.com/comic/the-talk-3https://www.smbc-comics.com/comic/the-talk-3&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ZuXB!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe08b91f0-2f2c-46be-baae-495c934b05dc_1110x1022.png 424w, https://substackcdn.com/image/fetch/$s_!ZuXB!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe08b91f0-2f2c-46be-baae-495c934b05dc_1110x1022.png 848w, https://substackcdn.com/image/fetch/$s_!ZuXB!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe08b91f0-2f2c-46be-baae-495c934b05dc_1110x1022.png 1272w, https://substackcdn.com/image/fetch/$s_!ZuXB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe08b91f0-2f2c-46be-baae-495c934b05dc_1110x1022.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">This funny comic is &#8220;The Talk&#8221; by Zach Weinersmith of SMBC Comics. And yes, part of why I blog this that I&#8217;m realizing what pop-scientists lied to me about QM :)</figcaption></figure></div><p>The ECC zoo is maintained by <a href="https://errorcorrectionzoo.org/team">Victor V. Albert from NIST, Philippe Faist from Caltech and many others</a>. I don&#8217;t know the specifics of the error correction that Willow uses, but the core idea is the Kitaev surface code introduced in 2003. Once you have enough noisy qubits in the real world which we will call physical qubits, we you arrange them in a square grid and use some of them for redundancy  Kitaev&#8217;s code and get <em>logical </em>qubits. In theory, f you have enough logical qubits (which we unfortunately don&#8217;t with Willow), you can run the Shor&#8217;s algorithm that appears in movies. But &#8212; one day.</p><p>You can read this excellent Quanta Magazine on Google&#8217;s Willow progress, as well as error correcting codes here: <a href="https://www.quantamagazine.org/quantum-computers-cross-critical-error-threshold-20241209/">https://www.quantamagazine.org/quantum-computers-cross-critical-error-threshold-20241209/</a></p><div><hr></div><p>P.S. The ECC Zoo can be cited as:</p><pre><code>@book{ErrorCorrectionZoo,
  title={The Error Correction Zoo},
  year={2024},
  editor={Victor V. Albert and Philippe Faist},
  url={https://errorcorrectionzoo.org/}
}</code></pre><p>It is inspired by the related &#8220;CS zoo&#8221; called Complexity Zoo started in 2002 that contains 500+ classes from complexity theory:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://complexityzoo.net/Complexity_Zoo" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!CsxI!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F127a2f68-9431-40fc-8007-6e904d011564_2308x1038.png 424w, https://substackcdn.com/image/fetch/$s_!CsxI!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F127a2f68-9431-40fc-8007-6e904d011564_2308x1038.png 848w, https://substackcdn.com/image/fetch/$s_!CsxI!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F127a2f68-9431-40fc-8007-6e904d011564_2308x1038.png 1272w, https://substackcdn.com/image/fetch/$s_!CsxI!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F127a2f68-9431-40fc-8007-6e904d011564_2308x1038.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!CsxI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F127a2f68-9431-40fc-8007-6e904d011564_2308x1038.png" width="1456" height="655" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/127a2f68-9431-40fc-8007-6e904d011564_2308x1038.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:655,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:470912,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://complexityzoo.net/Complexity_Zoo&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!CsxI!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F127a2f68-9431-40fc-8007-6e904d011564_2308x1038.png 424w, https://substackcdn.com/image/fetch/$s_!CsxI!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F127a2f68-9431-40fc-8007-6e904d011564_2308x1038.png 848w, https://substackcdn.com/image/fetch/$s_!CsxI!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F127a2f68-9431-40fc-8007-6e904d011564_2308x1038.png 1272w, https://substackcdn.com/image/fetch/$s_!CsxI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F127a2f68-9431-40fc-8007-6e904d011564_2308x1038.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption"></figcaption></figure></div><p></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.fikisipi.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Subscribe for free to receive new posts:</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[Busy Beaver, the current BB(5) conjecture and bbchallenge.org]]></title><description><![CDATA[Happy birthday, Alan Turing!]]></description><link>https://www.fikisipi.com/p/busy-beaver-the-current-bb5-conjecture</link><guid isPermaLink="false">https://www.fikisipi.com/p/busy-beaver-the-current-bb5-conjecture</guid><dc:creator><![CDATA[Filip Dimitrovski]]></dc:creator><pubDate>Mon, 24 Jun 2024 20:10:11 GMT</pubDate><enclosure url="https://substackcdn.com/image/youtube/w_728,c_limit/CE8UhcyJS0I" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I first read about the Busy Beaver function in the essay <a href="https://www.scottaaronson.com/writings/bignumbers.html">Who Can Name the Bigger Number?</a> which is a funny story published 19 years ago, involving a &#8220;quickly name a big number&#8221; competition, where small kids will use digits, high schoolers will use exponentials, undergrads will use factorials or repeated factorials &#8230; until you get to theoretical computer scientists and/or philosophers. They will invent abstract structures to explain huge numbers. One of them is connected to <strong>Alan Turing</strong> &#8212; a person whose <strong>birthday was today</strong> (or yesterday, depending on timezone, arghh). I highly recommend reading the story. It mentions Turing Machines, DNA, intelligence as grasping big numbers, people&#8217;s phobia of big numbers; and the <em>Busy Beaver function itself</em>. </p><p>Then, 8 years ago, Professor Brailsford of Computerphile fame, explained the Busy Beaver game in video format (you can watch the video, and it involves the Busy Beaver game for some n: an abstract computer i.e. a Turing Machine is some abstract machine that can be in <em>n</em> different states, and the goal is to find a machine that works hard changing its memory without ending in an endless loop):</p><div id="youtube2-CE8UhcyJS0I" class="youtube-wrap" data-attrs="{&quot;videoId&quot;:&quot;CE8UhcyJS0I&quot;,&quot;startTime&quot;:null,&quot;endTime&quot;:null}" data-component-name="Youtube2ToDOM"><div class="youtube-inner"><iframe src="https://www.youtube-nocookie.com/embed/CE8UhcyJS0I?rel=0&amp;autoplay=0&amp;showinfo=0&amp;enablejsapi=0" frameborder="0" loading="lazy" gesture="media" allow="autoplay; fullscreen" allowautoplay="true" allowfullscreen="true" width="728" height="409"></iframe></div></div><p>Throughout his video, he relates the beaver game to the function BB(n) also known as S(n): the function that counts the maximum steps for a game with n states and he goes through the first few &#8220;scores&#8221; or steps. At 13:31 he mentions that he doesn&#8217;t even wanna calculate how many Turing machines there are for <em>n</em>=5, much less calculate the value of <em>the max steps</em>.</p><p>Well, in 2022, <a href="https://www.scottaaronson.com/papers/bb.pdf">Aaronson conjectured that BB(5) = 47,176,870 </a>in a paper that analyzes the low-hanging fruits (as well as more difficult problems and challenges) regarding this fascinating function.</p><p>Then, some people (initiative by <em><a href="https://tristan.st/">Tristan St&#233;rin</a>, [edit] but he messaged me to mention all <a href="https://bbchallenge.org/team">the 20+ highly collaborative people</a> that are producing the results!</em>) started <a href="https://bbchallenge.org/">bbchallenge.org</a> to solve it. You can read <a href="https://bbchallenge.org/story">the story here</a> &#8212; they read Aaronson&#8217;s paper and decided they will write independent deciders, i.e. programs that will decide the behavior of families of machines that are well-known.</p><p><a href="https://discuss.bbchallenge.org/t/may-2nd-2024-releasing-bouncers-only-2-833-machines-to-go/231">This month we&#8217;ve got some proofs that are ready to be analyzed that in fact prove this.</a> </p><p>As <em>Tristan St&#233;rin</em> says:</p><blockquote><p>Nonetheless, bbchallenge&#8217;s endgame approaches and we&#8217;re very excited for what comes next!</p><p>Beaverly yours,</p></blockquote><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!hMyc!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa714791-72e5-48b6-b718-8365ca32e685_72x72.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!hMyc!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa714791-72e5-48b6-b718-8365ca32e685_72x72.png 424w, https://substackcdn.com/image/fetch/$s_!hMyc!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa714791-72e5-48b6-b718-8365ca32e685_72x72.png 848w, https://substackcdn.com/image/fetch/$s_!hMyc!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa714791-72e5-48b6-b718-8365ca32e685_72x72.png 1272w, https://substackcdn.com/image/fetch/$s_!hMyc!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa714791-72e5-48b6-b718-8365ca32e685_72x72.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!hMyc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa714791-72e5-48b6-b718-8365ca32e685_72x72.png" width="72" height="72" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fa714791-72e5-48b6-b718-8365ca32e685_72x72.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:72,&quot;width&quot;:72,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;:beaver:&quot;,&quot;title&quot;:&quot;:beaver:&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt=":beaver:" title=":beaver:" srcset="https://substackcdn.com/image/fetch/$s_!hMyc!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa714791-72e5-48b6-b718-8365ca32e685_72x72.png 424w, https://substackcdn.com/image/fetch/$s_!hMyc!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa714791-72e5-48b6-b718-8365ca32e685_72x72.png 848w, https://substackcdn.com/image/fetch/$s_!hMyc!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa714791-72e5-48b6-b718-8365ca32e685_72x72.png 1272w, https://substackcdn.com/image/fetch/$s_!hMyc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa714791-72e5-48b6-b718-8365ca32e685_72x72.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>If you want to help solve BB(5) (by taking a look at the proof or otherwise) or even take a look at BB(6), you can also join the <a href="https://discord.gg/3uqtPJA9Uv">Discord server</a>.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.fikisipi.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Fikisipi! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[A look at (the demo of) Devin, the AI-powered software engineer]]></title><description><![CDATA[Cognition Labs and their demo of an automated software engineer]]></description><link>https://www.fikisipi.com/p/short-post-a-look-at-devin-the-ai</link><guid isPermaLink="false">https://www.fikisipi.com/p/short-post-a-look-at-devin-the-ai</guid><dc:creator><![CDATA[Filip Dimitrovski]]></dc:creator><pubDate>Tue, 12 Mar 2024 23:20:06 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/00dadd4a-7678-43c4-8e3e-81dc2e380ff4_1456x1048.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em><strong>15 April edit</strong></em><strong>:</strong> a few hours later after publishing this article in March, I <a href="https://twitter.com/asmeurer/status/1767846446890418264">communicated with Aaron Mauer (sympy&#8217;s developer) via Twitter</a> about a potential data bias which made me suspicious and I added the prefix <em>(the demo of)</em> to the title and a SWE-Bench recency disclaimer. Today, Devin has been <strong>&#8220;canceled&#8221;</strong> by a significant portion of the developer community for overpromising with a demo and underdelivering. I haven&#8217;t got access to the product so I don&#8217;t have an opinion, <strong>but I still believe it might be a valuable product</strong>, even though it is &#8220;just&#8221; a ChatGPT wrapper.</p><div><hr></div><p>On March 12 2024, <a href="https://www.cognition-labs.com/">Cognition Labs</a>, a novel name for the public (but with the #1 gold IOI &#8216;14 medalist behind it) showed a demo of <strong>Devin</strong> - the &#8220;AI-powered software engineer&#8221;:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://twitter.com/cognition_labs/status/1767548763134964000" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!WCZO!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b2b9d02-f43a-4c2b-877f-945b9a8b3462_1608x1360.png 424w, https://substackcdn.com/image/fetch/$s_!WCZO!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b2b9d02-f43a-4c2b-877f-945b9a8b3462_1608x1360.png 848w, https://substackcdn.com/image/fetch/$s_!WCZO!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b2b9d02-f43a-4c2b-877f-945b9a8b3462_1608x1360.png 1272w, https://substackcdn.com/image/fetch/$s_!WCZO!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b2b9d02-f43a-4c2b-877f-945b9a8b3462_1608x1360.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!WCZO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b2b9d02-f43a-4c2b-877f-945b9a8b3462_1608x1360.png" width="445" height="376.2328296703297" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9b2b9d02-f43a-4c2b-877f-945b9a8b3462_1608x1360.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1231,&quot;width&quot;:1456,&quot;resizeWidth&quot;:445,&quot;bytes&quot;:1237524,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://twitter.com/cognition_labs/status/1767548763134964000&quot;,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!WCZO!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b2b9d02-f43a-4c2b-877f-945b9a8b3462_1608x1360.png 424w, https://substackcdn.com/image/fetch/$s_!WCZO!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b2b9d02-f43a-4c2b-877f-945b9a8b3462_1608x1360.png 848w, https://substackcdn.com/image/fetch/$s_!WCZO!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b2b9d02-f43a-4c2b-877f-945b9a8b3462_1608x1360.png 1272w, https://substackcdn.com/image/fetch/$s_!WCZO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b2b9d02-f43a-4c2b-877f-945b9a8b3462_1608x1360.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">twitter.com/cognition_labs/status/1767548763134964000</figcaption></figure></div><p>The only way to access Devin is to sign up on a form/waitlist, so we cannot be sure how well this video demonstrates the capabilities<em> &#8212; </em>but let&#8217;s analyze their work, the investors, the team and the claims on Twitter.</p><p>They claim they found a job on Upwork.com (related to computer vision and Python) and made Devin complete it:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!yka3!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6575e1fb-a886-44c3-949e-1688e97932a8_1106x826.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!yka3!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6575e1fb-a886-44c3-949e-1688e97932a8_1106x826.png 424w, https://substackcdn.com/image/fetch/$s_!yka3!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6575e1fb-a886-44c3-949e-1688e97932a8_1106x826.png 848w, https://substackcdn.com/image/fetch/$s_!yka3!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6575e1fb-a886-44c3-949e-1688e97932a8_1106x826.png 1272w, https://substackcdn.com/image/fetch/$s_!yka3!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6575e1fb-a886-44c3-949e-1688e97932a8_1106x826.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!yka3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6575e1fb-a886-44c3-949e-1688e97932a8_1106x826.png" width="535" height="399.55696202531647" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6575e1fb-a886-44c3-949e-1688e97932a8_1106x826.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:826,&quot;width&quot;:1106,&quot;resizeWidth&quot;:535,&quot;bytes&quot;:313879,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!yka3!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6575e1fb-a886-44c3-949e-1688e97932a8_1106x826.png 424w, https://substackcdn.com/image/fetch/$s_!yka3!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6575e1fb-a886-44c3-949e-1688e97932a8_1106x826.png 848w, https://substackcdn.com/image/fetch/$s_!yka3!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6575e1fb-a886-44c3-949e-1688e97932a8_1106x826.png 1272w, https://substackcdn.com/image/fetch/$s_!yka3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6575e1fb-a886-44c3-949e-1688e97932a8_1106x826.png 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">I censored the link, but the demo shows the actual Upwork listing</figcaption></figure></div><p>&#8230; Devin fails due to a PyTorch version issue, fixes it, asks a few questions about the output and <a href="https://twitter.com/cognition_labs/status/1767548768734294113">fully completes the task</a>! This is impressive, but it doesn&#8217;t end there. One of the extra videos shows a complex case where the user is supplying Devin a link to a GitHub repo that&#8217;s an old fork of the math library <a href="https://github.com/sympy/sympy/">SymPy</a> with a really difficult bug in logarithm calculations: </p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!pBpn!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc64baaec-cb87-4c51-83fa-1f06231c1509_2056x776.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!pBpn!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc64baaec-cb87-4c51-83fa-1f06231c1509_2056x776.png 424w, https://substackcdn.com/image/fetch/$s_!pBpn!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc64baaec-cb87-4c51-83fa-1f06231c1509_2056x776.png 848w, https://substackcdn.com/image/fetch/$s_!pBpn!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc64baaec-cb87-4c51-83fa-1f06231c1509_2056x776.png 1272w, https://substackcdn.com/image/fetch/$s_!pBpn!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc64baaec-cb87-4c51-83fa-1f06231c1509_2056x776.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!pBpn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc64baaec-cb87-4c51-83fa-1f06231c1509_2056x776.png" width="579" height="218.71565934065933" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c64baaec-cb87-4c51-83fa-1f06231c1509_2056x776.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:550,&quot;width&quot;:1456,&quot;resizeWidth&quot;:579,&quot;bytes&quot;:594905,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!pBpn!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc64baaec-cb87-4c51-83fa-1f06231c1509_2056x776.png 424w, https://substackcdn.com/image/fetch/$s_!pBpn!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc64baaec-cb87-4c51-83fa-1f06231c1509_2056x776.png 848w, https://substackcdn.com/image/fetch/$s_!pBpn!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc64baaec-cb87-4c51-83fa-1f06231c1509_2056x776.png 1272w, https://substackcdn.com/image/fetch/$s_!pBpn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc64baaec-cb87-4c51-83fa-1f06231c1509_2056x776.png 1456w" sizes="100vw"></picture><div></div></div></a></figure></div><p>Devin clones the repo, analyzes the whole SymPy codebase (!) and finds a division error related to the code for calculating logarithms, <a href="https://twitter.com/cognition_labs/status/1767548765924114881">fixes it and </a><strong><a href="https://twitter.com/cognition_labs/status/1767548765924114881">even runs tests</a></strong><a href="https://twitter.com/cognition_labs/status/1767548765924114881"> related to logarithms to make sure that the fix doesn&#8217;t affect other parts of the project:</a></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!0uc0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d4736a3-02d8-44f8-b3c6-30d39b3f1e06_1800x886.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!0uc0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d4736a3-02d8-44f8-b3c6-30d39b3f1e06_1800x886.png 424w, https://substackcdn.com/image/fetch/$s_!0uc0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d4736a3-02d8-44f8-b3c6-30d39b3f1e06_1800x886.png 848w, https://substackcdn.com/image/fetch/$s_!0uc0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d4736a3-02d8-44f8-b3c6-30d39b3f1e06_1800x886.png 1272w, https://substackcdn.com/image/fetch/$s_!0uc0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d4736a3-02d8-44f8-b3c6-30d39b3f1e06_1800x886.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!0uc0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d4736a3-02d8-44f8-b3c6-30d39b3f1e06_1800x886.png" width="567" height="279.21634615384613" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1d4736a3-02d8-44f8-b3c6-30d39b3f1e06_1800x886.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:717,&quot;width&quot;:1456,&quot;resizeWidth&quot;:567,&quot;bytes&quot;:609339,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!0uc0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d4736a3-02d8-44f8-b3c6-30d39b3f1e06_1800x886.png 424w, https://substackcdn.com/image/fetch/$s_!0uc0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d4736a3-02d8-44f8-b3c6-30d39b3f1e06_1800x886.png 848w, https://substackcdn.com/image/fetch/$s_!0uc0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d4736a3-02d8-44f8-b3c6-30d39b3f1e06_1800x886.png 1272w, https://substackcdn.com/image/fetch/$s_!0uc0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d4736a3-02d8-44f8-b3c6-30d39b3f1e06_1800x886.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>And sure enough, if you look at SymPy this is the real world issue <a href="https://github.com/sympy/sympy/issues/17148">&#8220;#17148: Incorrect extraction of base powers in log class&#8221;</a>.</p><p>Considering it&#8217;s an issue from 2019, is there a chance it&#8217;s in the training dataset? I don&#8217;t know, but honestly it&#8217;s not even important. What&#8217;s truly important is how  Devin handles big contexts and how it works on such a huge repository. SymPy is a very complex project! My guess is that their magic sauce lies in iterative search and analysis of repositories when feeding the most important details to a transformer/LLM architecture. </p><h2>Who&#8217;s behind this?</h2><p>The supporters and investors include the Thiel&#8217;s Founders Fund, Doordash co-founder Tony Xu, Stripe CEO and cofounders Patrick Collison and John Collison, the founder of Modal Labs (the same Modal which I mentioned in a previous post), <a href="https://twitter.com/cognition_labs/status/1767548771506753941">and many others</a>.</p><p>As for the founders - Scott Wu is a Harvard graduate and Steven Hao is an MIT graduate, and they already have professional experience with software engineering and machine learning. They also have competitive programming experience - 10 International IOI (Olympiad in Informatics) gold medals, which I admire (timed tasks on difficult problems <em>are not for everybody </em>&#128516;). </p><p>People on social media quickly noticed that Wu was a legendary master on Codeforces and, as a small kid, <a href="https://twitter.com/TechBroDrip/status/1767706006010945867">used to be a really, really fast MATHCOUNTS champion</a> &#8212; to the point where he acts like a math-expression autocomplete.</p><h2>Do I think the demos are cherry-picked?</h2><p><strong>70% no, 30% yes</strong>. I&#8217;m sure that setting up or re-building many projects requires painful commands with package managers (and all the dependency hell experiences that engineers are used to), external and shared libraries, and obtaining tokens on third-party services that are outside of the scope of what state-of-the-art machine learning assistants can do.</p><p>That being said, if a human does the painful things - ML assistants will dominate at many tasks. Boilerplate code is definitely going to be a solved problem. A huge amount of debugging and compiler error tasks can be automated and some are even suited better for computers than humans - especially those revolving generics, floating point math, nested loops with many index variables and macros.</p><h2>What is SWE-Bench?</h2><p>A key selling point they claim is<strong> 13.86% unassisted score on SWE-Bench</strong>. So what&#8217;s SWE-Bench?</p><p><a href="https://arxiv.org/pdf/2310.06770.pdf">SWE-Bench is a paper and benchmark</a> from Princeton University and the University of Chicago that contains instances of unsolved (GitHub) issues. The input is the whole codebase and a human-readable issue, and the expected output is a patch to the codebase. Fundamentally, the task is to solve the issues without breaking the tests. The benchmark is really hard and approaches using Claude and GPT-4  can solve 0-2% of the task:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Gy_8!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7dee69e1-b6ad-48cb-aa53-e5799d291f6d_2250x388.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Gy_8!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7dee69e1-b6ad-48cb-aa53-e5799d291f6d_2250x388.png 424w, https://substackcdn.com/image/fetch/$s_!Gy_8!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7dee69e1-b6ad-48cb-aa53-e5799d291f6d_2250x388.png 848w, https://substackcdn.com/image/fetch/$s_!Gy_8!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7dee69e1-b6ad-48cb-aa53-e5799d291f6d_2250x388.png 1272w, https://substackcdn.com/image/fetch/$s_!Gy_8!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7dee69e1-b6ad-48cb-aa53-e5799d291f6d_2250x388.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Gy_8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7dee69e1-b6ad-48cb-aa53-e5799d291f6d_2250x388.png" width="1456" height="251" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7dee69e1-b6ad-48cb-aa53-e5799d291f6d_2250x388.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:251,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:90427,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Gy_8!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7dee69e1-b6ad-48cb-aa53-e5799d291f6d_2250x388.png 424w, https://substackcdn.com/image/fetch/$s_!Gy_8!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7dee69e1-b6ad-48cb-aa53-e5799d291f6d_2250x388.png 848w, https://substackcdn.com/image/fetch/$s_!Gy_8!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7dee69e1-b6ad-48cb-aa53-e5799d291f6d_2250x388.png 1272w, https://substackcdn.com/image/fetch/$s_!Gy_8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7dee69e1-b6ad-48cb-aa53-e5799d291f6d_2250x388.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>&#8230; This is why SWE-Bench also has an assisted version where a human can intervene - which can get Claude and GPT-4 to 4%. But Devin claims 13.86% <strong>unassisted</strong> score. I find this impressive, but I also think <strong>it&#8217;s a benchmark that&#8217;s too recent</strong>, since it comes from ICLR 2024 and many projects will be in the 4-6% range once it becomes more mainstream and well-recognized.</p><h2>Conclusion</h2><p>I hope we get access to Devin soon so that we can evaluate it without guessing, but I&#8217;m optimistic about its performance. I think it&#8217;s <strong>way, way too early</strong> to claim that software engineering has been automated or obsoleted, and I think Devin and similar tools are <strong>just going to be tools that are going to accelerate talented engineers</strong>.</p><p>On top of that, if you are scared, consider the fact that software engineering is not just about making pull requests related to a small subset of types of bugs, it&#8217;s also about planning, negotiating, meeting clients&#8217; needs and talking to non-engineers.</p><p>In any case, I wish Cognition Labs a successful launch!</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.fikisipi.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Fikisipi! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[The man that disrupted Macedonian online media using clustering algorithms]]></title><description><![CDATA[The lack of local Yahoo/Google News as Trajkovski&#8217;s opportunity to transform the Macedonian web]]></description><link>https://www.fikisipi.com/p/the-man-that-disrupted-macedonian</link><guid isPermaLink="false">https://www.fikisipi.com/p/the-man-that-disrupted-macedonian</guid><dc:creator><![CDATA[Filip Dimitrovski]]></dc:creator><pubDate>Tue, 19 Dec 2023 13:16:22 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!lDt6!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf23423b-589a-432b-861b-66a5ea81aac5_1442x1038.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!lDt6!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf23423b-589a-432b-861b-66a5ea81aac5_1442x1038.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!lDt6!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf23423b-589a-432b-861b-66a5ea81aac5_1442x1038.png 424w, https://substackcdn.com/image/fetch/$s_!lDt6!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf23423b-589a-432b-861b-66a5ea81aac5_1442x1038.png 848w, https://substackcdn.com/image/fetch/$s_!lDt6!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf23423b-589a-432b-861b-66a5ea81aac5_1442x1038.png 1272w, https://substackcdn.com/image/fetch/$s_!lDt6!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf23423b-589a-432b-861b-66a5ea81aac5_1442x1038.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!lDt6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf23423b-589a-432b-861b-66a5ea81aac5_1442x1038.png" width="430" height="309.5284327323162" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/af23423b-589a-432b-861b-66a5ea81aac5_1442x1038.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1038,&quot;width&quot;:1442,&quot;resizeWidth&quot;:430,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!lDt6!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf23423b-589a-432b-861b-66a5ea81aac5_1442x1038.png 424w, https://substackcdn.com/image/fetch/$s_!lDt6!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf23423b-589a-432b-861b-66a5ea81aac5_1442x1038.png 848w, https://substackcdn.com/image/fetch/$s_!lDt6!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf23423b-589a-432b-861b-66a5ea81aac5_1442x1038.png 1272w, https://substackcdn.com/image/fetch/$s_!lDt6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf23423b-589a-432b-861b-66a5ea81aac5_1442x1038.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Although Macedonia is sometimes known as the country that produced fake news during the <a href="https://www.bbc.com/future/article/20190528-i-was-a-macedonian-fake-news-writer">2016 US presidential election</a>, it has a positive phenomenon regarding online news that fascinated me during my teenage years. <em>The</em> most popular local website<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a> is <a href="https://time.mk/">TIME.MK</a> &#8211; a news aggregator that manages to aggregate credible online newspapers in a transparent and user-friendly fashion that I hadn&#8217;t seen before &#8211; especially since there&#8217;s no local Google/Yahoo News. And citizens love it, and many attempt to create clones of it.</p><p>TIME.MK was developed by a person named Igor Trajkovski. In this article, I&#8217;ll talk to him<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-2" href="#footnote-2" target="_self">2</a>, find out how it was launched and learn about his background,  inspirations and values.</p><p><strong>Filip: </strong>Before talking about your background and your projects, I&#8217;d like to ask: What is TIME.MK? If we were stuck in a 2-minute elevator conversation, how would you describe it?</p><p><strong>Igor</strong>: TIME.mk is a news aggregation platform that collects news articles from the biggest news websites in North Macedonia and by using the techniques from Natural Language Processing and Computational Journalism computes the top stories of the day. The way it is done is by first finding the stories, in the collection of news, by using techniques of <strong>document clustering</strong> and then ranking them according to the general criteria and proprietary algorithms.</p><p>The general criteria are: <strong>Bigger clusters</strong> are preferred, <strong>newer news</strong> are preferred, news from authoritative sources are preferred and <strong>diversified stories/clusters</strong> (by the number of sources that cover it) are preferred. The algorithm that runs behind TIME.mk is an amalgam of these four principles, and many other heuristics, that were learned through the 15 years of running the news aggregator.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!-ARn!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff12b15f0-a92f-4ee6-ad00-df60e888b3ec_2026x1306.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!-ARn!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff12b15f0-a92f-4ee6-ad00-df60e888b3ec_2026x1306.png 424w, https://substackcdn.com/image/fetch/$s_!-ARn!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff12b15f0-a92f-4ee6-ad00-df60e888b3ec_2026x1306.png 848w, https://substackcdn.com/image/fetch/$s_!-ARn!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff12b15f0-a92f-4ee6-ad00-df60e888b3ec_2026x1306.png 1272w, https://substackcdn.com/image/fetch/$s_!-ARn!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff12b15f0-a92f-4ee6-ad00-df60e888b3ec_2026x1306.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!-ARn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff12b15f0-a92f-4ee6-ad00-df60e888b3ec_2026x1306.png" width="1456" height="939" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f12b15f0-a92f-4ee6-ad00-df60e888b3ec_2026x1306.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:939,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1293044,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!-ARn!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff12b15f0-a92f-4ee6-ad00-df60e888b3ec_2026x1306.png 424w, https://substackcdn.com/image/fetch/$s_!-ARn!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff12b15f0-a92f-4ee6-ad00-df60e888b3ec_2026x1306.png 848w, https://substackcdn.com/image/fetch/$s_!-ARn!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff12b15f0-a92f-4ee6-ad00-df60e888b3ec_2026x1306.png 1272w, https://substackcdn.com/image/fetch/$s_!-ARn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff12b15f0-a92f-4ee6-ad00-df60e888b3ec_2026x1306.png 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Science and showbiz news on the front page of TIME.MK</figcaption></figure></div><p><strong>Filip: </strong>The concept of recent news-first and ordering by cluster size make sense. Without leaking the whole pipeline or magic sauce behind TIME.MK, can you share an example of an algorithmic technique or a class of techniques you've been using?</p><p><strong>Igor</strong>:&nbsp; For clustering, we employ a highly optimized and tailored version of the <strong>Hierarchical Agglomerative Clustering </strong><a href="https://en.wikipedia.org/wiki/Hierarchical_clustering">(HAC) algorithm</a>, with specific stopping criteria adjustments for merging. To measure the distance between clusters, we use the <a href="https://radimrehurek.com/gensim/auto_examples/tutorials/run_wmd.html">Word Mover's Distance Algorithm</a>, which leverages word embeddings trained on an extensive corpus of <strong>20 million news articles from 2001</strong>. In their basic forms, both algorithms are quite slow, making it challenging to complete the entire cycle of crawling, clustering, and ranking of 10k news in under a minute. However, through intelligent caching and optimizing recurring tasks in each cycle, achieving this speed becomes feasible.</p><p><strong>Filip: </strong>15 years is a long time. What was the inspiration for building it, and how did it start? I know it had something to do with your personal decision to move outside Macedonia.</p><p><strong>Igor</strong>: Yes. Living abroad from 2001 to 2008, I was interested in Macedonian affairs. I regularly browsed various news portals like A1, Dnevnik, Vecer, etc. I noticed that different sources highlighted different top stories and some even censored certain events or topics. To get a comprehensive view of major events, one had to visit all the major news outlets. <a href="https://en.wikipedia.org/wiki/Google_News#History">Google News, which emerged post-9/11</a>, addressed this issue but lacked a Macedonian edition, a common scenario even for larger countries at the time.</p><p>This gap sparked my initial inspiration. I was curious whether the news aggregation concept would be effective in a smaller country like Macedonia and if text processing algorithms could adapt to the Macedonian language. To be honest, I also looked for a solution to the problem of passive income, the real application of IT in general and AI in particular, while spending the abundant free time reading AI papers/news, philosophy, psychology and history.</p><p><strong>Filip: </strong>What were the biggest challenges during these 15 years?</p><p><strong>Igor</strong>: TIME.mk was launched in July 2008. Initially, during the first three years, it wasn't the most visited website. Its concept of news aggregation seemed to resonate primarily with a more educated audience. Many, even to this day, mistakenly perceive TIME.mk as a news source rather than a tool for accessing news. This misconception even led some news editors to believe we were plagiarizing their content, raising concerns about intellectual property infringement, though legal action was never pursued.</p><p>A pivotal moment in TIME.mk's history occurred in 2011, an event I liken to the mammalian rise 65 million years ago. This was when the major news source and <strong>largest TV station, a1.com.mk, was shut down</strong>. This led to the emergence of numerous opposition news websites, formed by former A1 journalists. However, none could match A1's comprehensive coverage. During Macedonia's particularly polarized political climate, TIME.mk stood out as the only platform offering real-time coverage of events from diverse political perspectives, attracting visitors across the political spectrum.</p><p>Since then, TIME.mk has been the most visited website in Macedonia. We've expanded our services, adding features like TopTweets analysis from the Macedonian Twitter sphere, aggregating TV shows and political debates available on YouTube, and developing efficient search engines for public procurements. These enhancements have further strengthened our position in the news market.</p><p>We encountered two significant technical challenges. The first was algorithmic: clustering similar news stories, even when sources use varied vocabulary for the same topics. Modern NLP tools, particularly word embeddings, were instrumental in overcoming this challenge. The second challenge related to infrastructure, specifically DDOS (Distributed Denial of Service) attacks.</p><p>Being a major news source, we attracted various attackers, both local and international, motivated by monetary or political gain, aiming to disrupt our service. Developing robust defenses against these attacks posed a considerable challenge.</p><p><strong>Filip: </strong>You mention that you lived abroad from 2001 to 2008. Reading your CV, you interned at Google and did research at Max Planck Institute for Computer Science in Germany and Jo&#382;ef Stefan Institute in Slovenia. I&#8217;d like to know a few things:</p><ol><li><p>The spicy one&#8230; <strong>What&#8217;s your opinion on publish-or-perish</strong>, p-hacking, grant and tenure negotiations in academia?</p></li><li><p><strong>Do you have a favorite professor, course or a story during these years?</strong></p></li><li><p>How does academia compare to the work at Google, and are R&amp;D labs (ex. Microsoft Research or what used to be Google Brain) a viable alternative too? I&#8217;ve heard that some people choose the academic path instead of engineering because they can&#8217;t stand the deadlines and meetings :)&nbsp;&nbsp;</p></li></ol><p><strong>Igor</strong>:&nbsp;</p><ol><li><p>I despise it. That 'publish-or-perish' mentality was one of the major reasons why I left my professorship, along with other issues related to how FINKI was managed. FINKI is the largest state Faculty for Computer Science in Macedonia. I never imagined that a research job could feel like working on a factory line, where you're expected to produce a certain number of papers within a set timeframe. This inevitably leads to unethical practices like p-hacking, plagiarism, self-plagiarism or recycling, and citation manipulation, all of which erode personal integrity. I'm ambivalent about the tenure system. It might be beneficial in social sciences, where it can protect professors' freedom to critique society without fear of losing their jobs. However, it also can be exploited by less productive professors who merely enjoy the status without fulfilling their responsibilities. This was a noticeable pattern at FINKI.</p></li><li><p>My favorite professor during my undergraduate studies was Prof. Dr. Oliver Popov. He taught an introductory course in computer science, focusing on computability and the philosophy related to the field. It's challenging to articulate the profound impact he had on us, instilling lifelong motivation and presenting computation as a reality-altering force. My favorite courses were 'Algorithms, Part I and II' from Princeton University, which I believe are fundamental to everything a computer scientist or programmer will ever build.</p></li></ol><ol start="3"><li><p>I've never held a research position in the industry, so I can't make a direct comparison. However, the research I conducted for my PhD was enjoyable. Although it required producing peer-reviewed journal papers, the timeframe was reasonable, and there wasn't excessive pressure or too many meetings. My industry experiences, including roles as a developer, left me less enthusiastic about agile development due to its frequent meetings and reports. Working in two Berlin startups, I found the division of responsibilities strange. In such environments, you're often expected to wear multiple hats &#8211; developer, tester, owner, dev-ops, etc. It was overwhelming to handle tasks beyond my expertise, like solving algorithmic problems, and also be responsible for implementing, testing, monitoring in production, and updating software as the environment evolved. There was an excess of tedious, uninteresting work.&nbsp;</p></li></ol><p><strong>Filip: </strong>So if I understand you correctly, It seems like being aware of your own competitive advantages was the key when it came to experimenting between academia, engineering or starting a business.</p><p>You mention philosophy and computability, so that&#8217;s what I&#8217;m aiming at for the final questions.&nbsp;</p><p><strong>What&#8217;s your favorite philosopher and philosophy-related book, and do you have any thoughts on determinism, free will and gene editing?</strong></p><p><strong>Igor</strong>:</p><p>I'm particularly drawn to 18th and 19th-century German philosophers from the Enlightenment era. These thinkers were at the forefront of constructing meaning without relying on the concept of God. This challenge resonates with me as we, as humans, keep wrestling with questions about our place in the universe and our origins. Our search for meaning likely stems from a desire for control and predictability, necessitating a story or framework to make sense of our existence.</p><p>Among these German philosophers, Schopenhauer and Hegel stand out to me. From more contemporary thinkers, I highly recommend 'The Denial of Death' by the anthropologist Ernest Becker. Becker's core argument in this book is that the primary psychological function of culture is to offer humans ways to deny the inevitability and fear of death. He suggests that a significant portion of human behavior is driven by an unconscious fear of death, with cultural institutions and beliefs providing meaning, order, and a sense of permanence to our lives.</p><p>When discussing determinism and free will, it's crucial to first define these concepts in the specific context. I lean towards determinism, and thus, the perspective that free will is an illusion. Our representational and prediction systems are not capable of foreseeing the future, leading to this misconception. If the universe operates deterministically (as Einstein suggested, 'God does not play dice'), then free will seems implausible since everything is determined by previous states of reality. Even in a non-deterministic universe, the origin of free will remains unclear to me.</p><p>Regarding gene editing, I view it as an inevitable next step in the evolution of medicine, building upon past advancements like antibiotics, vaccines, prosthetics, stents, bypass surgeries, and pacemakers.</p><p><strong>Filip: </strong>And for the final one. There&#8217;s a<a href="https://aimoprize.com/"> $10M prize for building an AI that wins an International Math Olympiad</a> and there&#8217;s tons of buzz regarding ChatGPT and LLMs.</p><p>Also there are claims that AI-powered robots will beat pro soccer players soon.</p><p>If you were to make a rough guess (you may use uncertainty and probabilities as percentages), how would you answer these:</p><ul><li><p><strong>How soon will the AI IMO prize be claimed?</strong></p></li><li><p><strong>When will AI-powered robots beat pro soccer players?</strong></p></li><li><p><strong>How likely is it that LLM/transformer-based solutions will be the first ones to solve a major human problem (including, but not limited to finding a cancer cure or solving unsolved math problems), or even worse, cause one (unaligned AGI that wants to hurt humanity)?</strong></p></li></ul><p><strong>Igor</strong>:</p><p>I predict that <strong>within 3-5 years, we'll see AI entities, not humans</strong>, winning gold medals at the International Mathematical Olympiad (IMO) and the International Olympiad in Informatics (IOI).</p><p>Regarding AI-powered robots in professional soccer, my forecast is that in<strong> less than a decade</strong>, a team of non-human players will be capable of defeating the world champions in soccer.</p><p>As for the potential of LLM/transformer-based solutions in solving or exacerbating major human issues, including but not limited to cancer or unsolved mathematical problems, there's significant potential. Current LLM systems, including finetuning and RLHF, could indeed aid in finding solutions. However, I have a gut feeling that they're primarily interpolating within the confines of their training datasets, lacking the necessary guidance for meaningful extrapolation beyond this data. Genuine creativity requires the ability to extrapolate and explore, along with a set of values, whether explicit (like survival instincts) or implicit (such as ethical or moral values), to drive progress. <em>Present-day LLMs lack both of these capabilities.</em></p><div><hr></div><p>I&#8217;d like to thank Igor for his time replying to my questions and hope that TIME.MK will continue with its good work.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.fikisipi.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption"><strong>Thanks for reading Fikisipi Lasered!</strong> Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-1" href="#footnote-anchor-1" class="footnote-number" contenteditable="false" target="_self">1</a><div class="footnote-content"><p>Proven for many periods after 2011 by Alexa (now defunct) and <a href="https://time.mk/info/marketing">Google Analytics data</a></p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-2" href="#footnote-anchor-2" class="footnote-number" contenteditable="false" target="_self">2</a><div class="footnote-content"><p>I personally met him during a summer internship at TIME.MK when I worked on word2vec experiments for the Macedonian language, so this interview is not completely unbiased &#128578;</p><p></p></div></div>]]></content:encoded></item><item><title><![CDATA[Cost-effective PyTorch model inference by utilizing Modal.com]]></title><description><![CDATA[How hard is it to deploy pretrained models on GPUs without tons of YAML files and unmanaged instances?]]></description><link>https://www.fikisipi.com/p/doing-cheap-pytorch-inference-with</link><guid isPermaLink="false">https://www.fikisipi.com/p/doing-cheap-pytorch-inference-with</guid><dc:creator><![CDATA[Filip Dimitrovski]]></dc:creator><pubDate>Sun, 19 Nov 2023 21:35:07 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/ebcb85ae-c46d-46fe-87b6-438628b76131_1456x1048.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>(Disclaimer: This is not a paid endorsement and I have no affiliation with Modal Labs.)</em></p><div><hr></div><p>A startup recently asked me to help them design an infrastructure where they can:</p><ul><li><p>run pre-trained PyTorch model on some inputs, such that the execution happens after some customer actions, but shouldn&#8217;t last more than an hour </p></li><li><p>try to avoid managing their own long-running GPU instances</p></li><li><p>be able to re-deploy newer versions of the model and monitor if and when the model crashes</p></li></ul><p>A lot of their infrastructure was hosted on AWS: S3 and DynamoDB for data, Cognito for authentication, but when it came to inference they were confused. A developer had built some prototypes with Lambda functions + SageMaker &#8212; the advertised solution for ML deployments, and it had some issues: Lambda execution time is limited at 15 minutes and configuring SageMaker&#8217;s environment became a messy pipeline which they couldn&#8217;t maintain<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a>. A lot of the SageMaker models that worked <em>had to run on a CPU</em>. The SageMaker examples repository contains <a href="https://github.com/aws/amazon-sagemaker-examples/tree/main/inference">amazon-sagemaker-examples/tree/main/inference</a><code> </code>which is full of empty folders and ipynb notebooks with 404 links.</p><p>As a startup, they were fine with taking a risk of moving the ML inference to any platform<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-2" href="#footnote-2" target="_self">2</a> (even platforms that <em>are startups themselves</em>) as long as they can get PyTorch running ASAP and the execution price is okay. </p><p>I already knew that people rent their GPUs on <a href="https://vast.ai/">vast.ai</a> at low rates, but even if the GPU owners signed their data processing contract, no one liked the idea of sending user data to hardware managed by strangers. I ran some quick Hacker News, Reddit, Google searches for cheap GPU inference and stumbled upon a comment mentioning <a href="https://modal.com/">Modal.com</a> so I decided to check it out.</p><p>The pricing page was very clear and concise. As of the time of writing, it looks like this:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!950T!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a17e58b-8baa-4da5-9dd9-65f472c4367b_1356x918.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!950T!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a17e58b-8baa-4da5-9dd9-65f472c4367b_1356x918.png 424w, https://substackcdn.com/image/fetch/$s_!950T!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a17e58b-8baa-4da5-9dd9-65f472c4367b_1356x918.png 848w, https://substackcdn.com/image/fetch/$s_!950T!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a17e58b-8baa-4da5-9dd9-65f472c4367b_1356x918.png 1272w, https://substackcdn.com/image/fetch/$s_!950T!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a17e58b-8baa-4da5-9dd9-65f472c4367b_1356x918.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!950T!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a17e58b-8baa-4da5-9dd9-65f472c4367b_1356x918.png" width="432" height="292.46017699115043" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7a17e58b-8baa-4da5-9dd9-65f472c4367b_1356x918.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:918,&quot;width&quot;:1356,&quot;resizeWidth&quot;:432,&quot;bytes&quot;:413875,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!950T!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a17e58b-8baa-4da5-9dd9-65f472c4367b_1356x918.png 424w, https://substackcdn.com/image/fetch/$s_!950T!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a17e58b-8baa-4da5-9dd9-65f472c4367b_1356x918.png 848w, https://substackcdn.com/image/fetch/$s_!950T!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a17e58b-8baa-4da5-9dd9-65f472c4367b_1356x918.png 1272w, https://substackcdn.com/image/fetch/$s_!950T!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a17e58b-8baa-4da5-9dd9-65f472c4367b_1356x918.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>At first glance it's good, so I decided to compare them with AWS. A g4dn.xlarge would correspond to NVIDIA T4 and AWS would charge <strong>$0.000146/s</strong> while Modal is at <strong>$0.000164/s</strong> which is a <strong>12% margin </strong>(same for hourly rates)<strong>.</strong> That&#8217;s reasonable for us - as long as Modal helps us deploy and monitor our model without hassle.</p><p>By the way, if you haven&#8217;t run models in production and want to understand ML inference economics in practice, here&#8217;s an example: running OpenAI&#8217;s speech-to-text model (Whisper Large) given a 5 minute English audio input on an NVIDIA T4 would take around 30 seconds. That means a single Whisper call can cost $0.00438.</p><p>So I did the well-marketed <code>pip install modal</code>  one-liner and logged in with a fresh account. It doesn&#8217;t require a credit card by default (yet?) and I got $30 free credit which could power our use for quite some time. Squaring an integer on a remote CPU is simple:</p><pre><code>import modal

stub = modal.Stub("fiki-demo")

@stub.function()
def f(i):
    return i * i

@stub.local_entrypoint()
def main():
    # Call f locally
    print(f.local(1000))

    # Call f on Modal's cloud CPU
    print(f.remote(1000))</code></pre><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!4FXv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F25d20e29-bc54-492a-9a03-5636d501dd16_2422x1148.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!4FXv!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F25d20e29-bc54-492a-9a03-5636d501dd16_2422x1148.png 424w, https://substackcdn.com/image/fetch/$s_!4FXv!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F25d20e29-bc54-492a-9a03-5636d501dd16_2422x1148.png 848w, https://substackcdn.com/image/fetch/$s_!4FXv!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F25d20e29-bc54-492a-9a03-5636d501dd16_2422x1148.png 1272w, https://substackcdn.com/image/fetch/$s_!4FXv!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F25d20e29-bc54-492a-9a03-5636d501dd16_2422x1148.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!4FXv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F25d20e29-bc54-492a-9a03-5636d501dd16_2422x1148.png" width="1456" height="690" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/25d20e29-bc54-492a-9a03-5636d501dd16_2422x1148.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:690,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:165667,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!4FXv!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F25d20e29-bc54-492a-9a03-5636d501dd16_2422x1148.png 424w, https://substackcdn.com/image/fetch/$s_!4FXv!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F25d20e29-bc54-492a-9a03-5636d501dd16_2422x1148.png 848w, https://substackcdn.com/image/fetch/$s_!4FXv!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F25d20e29-bc54-492a-9a03-5636d501dd16_2422x1148.png 1272w, https://substackcdn.com/image/fetch/$s_!4FXv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F25d20e29-bc54-492a-9a03-5636d501dd16_2422x1148.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Just do <code>modal run yourfile.py</code> and it works. So how do I attach a GPU? Turns out it&#8217;s just a matter of editing the decorator:</p><div class="github-gist" data-attrs="{&quot;innerHTML&quot;:&quot;<div id=\&quot;gist126380590\&quot; class=\&quot;gist\&quot;>\n    <div class=\&quot;gist-file\&quot; translate=\&quot;no\&quot;>\n      <div class=\&quot;gist-data\&quot;>\n        <div class=\&quot;js-gist-file-update-container js-task-list-container file-box\&quot;>\n  <div id=\&quot;file-modal-md\&quot; class=\&quot;file my-2\&quot;>\n      <div id=\&quot;file-modal-md-readme\&quot; class=\&quot;Box-body readme blob js-code-block-container p-5 p-xl-6 \&quot;>\n    <article class=\&quot;markdown-body entry-content container-lg\&quot; itemprop=\&quot;text\&quot;><div class=\&quot;highlight highlight-source-diff\&quot; dir=\&quot;auto\&quot;><pre><span class=\&quot;pl-md\&quot;><span class=\&quot;pl-md\&quot;>-</span> @stub.function()</span>\n<span class=\&quot;pl-mi1\&quot;><span class=\&quot;pl-mi1\&quot;>+</span> @stub.function(gpu=\&quot;T4\&quot;)</span>\ndef f(i):\n    return i * i</pre></div>\n</article>\n  </div>\n\n  </div>\n</div>\n\n      </div>\n      <div class=\&quot;gist-meta\&quot;>\n        <a href=\&quot;https://gist.github.com/fikisipi/3f01cb28c6b5bec204764b3ef5ea8ba8/raw/1fcf4f7bbc816c90d69a786e45330d8792b1aaca/modal.md\&quot; style=\&quot;float:right\&quot; class=\&quot;Link--inTextBlock\&quot;>view raw</a>\n        <a href=\&quot;https://gist.github.com/fikisipi/3f01cb28c6b5bec204764b3ef5ea8ba8#file-modal-md\&quot; class=\&quot;Link--inTextBlock\&quot;>\n          modal.md\n        </a>\n        hosted with &amp;#10084; by <a class=\&quot;Link--inTextBlock\&quot; href=\&quot;https://github.com\&quot;>GitHub</a>\n      </div>\n    </div>\n</div>\n&quot;,&quot;stylesheet&quot;:&quot;https://github.githubassets.com/assets/gist-embed-232d920b3dfe.css&quot;}" data-component-name="GitgistToDOM"><link rel="stylesheet" href="https://github.githubassets.com/assets/gist-embed-232d920b3dfe.css"><div id="gist126380590" class="gist">
    <div class="gist-file">
      <div class="gist-data">
        <div class="js-gist-file-update-container js-task-list-container file-box">
  <div id="file-modal-md" class="file my-2">
      <div id="file-modal-md-readme" class="Box-body readme blob js-code-block-container p-5 p-xl-6 ">
    <article class="markdown-body entry-content container-lg" itemprop="text"><div class="highlight highlight-source-diff"><pre><span class="pl-md"><span class="pl-md">-</span> @stub.function()</span>
<span class="pl-mi1"><span class="pl-mi1">+</span> @stub.function(gpu="T4")</span>
def f(i):
    return i * i</pre></div>
</article>
  </div>

  </div>
</div>

      </div>
      <div class="gist-meta">
        <a href="https://gist.github.com/fikisipi/3f01cb28c6b5bec204764b3ef5ea8ba8/raw/1fcf4f7bbc816c90d69a786e45330d8792b1aaca/modal.md" style="float:right" class="Link--inTextBlock">view raw</a>
        <a href="https://gist.github.com/fikisipi/3f01cb28c6b5bec204764b3ef5ea8ba8#file-modal-md" class="Link--inTextBlock">
          modal.md
        </a>
        hosted with &#10084; by <a class="Link--inTextBlock" href="https://github.com">GitHub</a>
      </div>
    </div>
</div>
</div><p>And how do we ship dependencies like <code>ffmpeg</code>, our AWS secrets, install PyTorch and the pretrained model? It&#8217;s quite simple actually. Modal builds Docker images with your code attached, and you have full control over the Dockerfile - <strong>scroll to the bottom of the post for an example</strong>.</p><p>In addition, once you like how <code>model run yourfile.py</code> works, you can deploy your model to production and <a href="https://modal.com/docs/guide/webhook-urls">generate a REST API</a>. The dashboard let&#8217;s you see some nice stats (as well as build logs, runtime logs, etc) and billing info.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!nhy_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6042fd81-3206-43eb-8091-08ac5f78948c_1116x626.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!nhy_!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6042fd81-3206-43eb-8091-08ac5f78948c_1116x626.png 424w, https://substackcdn.com/image/fetch/$s_!nhy_!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6042fd81-3206-43eb-8091-08ac5f78948c_1116x626.png 848w, https://substackcdn.com/image/fetch/$s_!nhy_!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6042fd81-3206-43eb-8091-08ac5f78948c_1116x626.png 1272w, https://substackcdn.com/image/fetch/$s_!nhy_!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6042fd81-3206-43eb-8091-08ac5f78948c_1116x626.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!nhy_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6042fd81-3206-43eb-8091-08ac5f78948c_1116x626.png" width="1116" height="626" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6042fd81-3206-43eb-8091-08ac5f78948c_1116x626.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:626,&quot;width&quot;:1116,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:78316,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!nhy_!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6042fd81-3206-43eb-8091-08ac5f78948c_1116x626.png 424w, https://substackcdn.com/image/fetch/$s_!nhy_!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6042fd81-3206-43eb-8091-08ac5f78948c_1116x626.png 848w, https://substackcdn.com/image/fetch/$s_!nhy_!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6042fd81-3206-43eb-8091-08ac5f78948c_1116x626.png 1272w, https://substackcdn.com/image/fetch/$s_!nhy_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6042fd81-3206-43eb-8091-08ac5f78948c_1116x626.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Concise CPU/GPU/memory billing, plotted for each day</figcaption></figure></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!DZsr!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28a300eb-ddfd-4650-8ee6-cda935182e28_2310x1536.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!DZsr!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28a300eb-ddfd-4650-8ee6-cda935182e28_2310x1536.png 424w, https://substackcdn.com/image/fetch/$s_!DZsr!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28a300eb-ddfd-4650-8ee6-cda935182e28_2310x1536.png 848w, https://substackcdn.com/image/fetch/$s_!DZsr!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28a300eb-ddfd-4650-8ee6-cda935182e28_2310x1536.png 1272w, https://substackcdn.com/image/fetch/$s_!DZsr!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28a300eb-ddfd-4650-8ee6-cda935182e28_2310x1536.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!DZsr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28a300eb-ddfd-4650-8ee6-cda935182e28_2310x1536.png" width="1456" height="968" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/28a300eb-ddfd-4650-8ee6-cda935182e28_2310x1536.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:968,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:224478,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!DZsr!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28a300eb-ddfd-4650-8ee6-cda935182e28_2310x1536.png 424w, https://substackcdn.com/image/fetch/$s_!DZsr!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28a300eb-ddfd-4650-8ee6-cda935182e28_2310x1536.png 848w, https://substackcdn.com/image/fetch/$s_!DZsr!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28a300eb-ddfd-4650-8ee6-cda935182e28_2310x1536.png 1272w, https://substackcdn.com/image/fetch/$s_!DZsr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28a300eb-ddfd-4650-8ee6-cda935182e28_2310x1536.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Stats on a daily basis</figcaption></figure></div><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!VURN!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7a0bdd5-b8b6-455a-a7aa-b78fbf53d60a_2360x498.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!VURN!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7a0bdd5-b8b6-455a-a7aa-b78fbf53d60a_2360x498.png 424w, https://substackcdn.com/image/fetch/$s_!VURN!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7a0bdd5-b8b6-455a-a7aa-b78fbf53d60a_2360x498.png 848w, https://substackcdn.com/image/fetch/$s_!VURN!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7a0bdd5-b8b6-455a-a7aa-b78fbf53d60a_2360x498.png 1272w, https://substackcdn.com/image/fetch/$s_!VURN!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7a0bdd5-b8b6-455a-a7aa-b78fbf53d60a_2360x498.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!VURN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7a0bdd5-b8b6-455a-a7aa-b78fbf53d60a_2360x498.png" width="1456" height="307" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a7a0bdd5-b8b6-455a-a7aa-b78fbf53d60a_2360x498.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:307,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:197461,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!VURN!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7a0bdd5-b8b6-455a-a7aa-b78fbf53d60a_2360x498.png 424w, https://substackcdn.com/image/fetch/$s_!VURN!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7a0bdd5-b8b6-455a-a7aa-b78fbf53d60a_2360x498.png 848w, https://substackcdn.com/image/fetch/$s_!VURN!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7a0bdd5-b8b6-455a-a7aa-b78fbf53d60a_2360x498.png 1272w, https://substackcdn.com/image/fetch/$s_!VURN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7a0bdd5-b8b6-455a-a7aa-b78fbf53d60a_2360x498.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Searchable logs for a single or multiple inference calls</figcaption></figure></div><p>A model with CUDA, torch, ffmpeg running on T4 cloud, assuming you have a local Python package with <code>myapp/__init__.py</code> and a <code>do_something()</code> model would look like this:</p><pre><code><code>import modal
from modal import (
    Image,
    Mount,
    Secret,
    method,
)

image = (
    Image.from_registry(
        "pytorch/pytorch:2.0.1-cuda11.7-cudnn8-devel",
    )
    .pip_install(
        "openai==0.27.2"
    )
    .apt_install("ffmpeg")
)

stub = modal.Stub(
    "fiki-demo",
    image=image,
    secrets=[Secret.from_name("prod")],
    mounts=[
        Mount.from_local_python_packages("myapp")
    ],
)


@stub.cls(
    timeout=80000,
    gpu="T4"
)
class DiarModel:
    @method()
    def detect(self, data: bytes):
      import torch
      print("Is CUDA available:", torch.cuda.is_available())
      import myapp
      return myapp.do_something(data)
</code></code></pre><p>A call is just a matter of <code>DiarModel().detect.remote(data) </code>and deploying from CLI is just <code>modal deploy yourfile.py</code>.</p><p>If you can design functions that return JSON serializable data then you can also wrap them with <code>@modal.web_endpoint(method="POST")</code>and your deployment tab will show you the appropriate endpoint URL. <em>Note:</em> I haven&#8217;t checked the pricing on REST API bandwidth - if you have more information, please send me a message or comment: is it better to host big blobs on S3 or return them directly?</p><p><strong>In conclusion,</strong> it&#8217;s been a pleasant surprise. At a 12% margin over raw AWS resources, you get a very nice development experience: a well designed CLI, dashboard, Google Colab-like responsiveness and a REST API (that boots GPU code within milliseconds) which you can use to get ML output.</p><p>It does seem like they are a young Series A company, which depending on your risk-aversion could mean they are not a suitable choice for you. <a href="https://status.modal.com/">Their status page</a> indicates they utilize Google Cloud Platform, AWS and Oracle Cloud in order to power the code execution and they have &gt;99.9% uptime so far:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!1S_g!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F25862d99-b35f-4c48-8553-03bc7db2a86b_1580x756.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!1S_g!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F25862d99-b35f-4c48-8553-03bc7db2a86b_1580x756.png 424w, https://substackcdn.com/image/fetch/$s_!1S_g!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F25862d99-b35f-4c48-8553-03bc7db2a86b_1580x756.png 848w, https://substackcdn.com/image/fetch/$s_!1S_g!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F25862d99-b35f-4c48-8553-03bc7db2a86b_1580x756.png 1272w, https://substackcdn.com/image/fetch/$s_!1S_g!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F25862d99-b35f-4c48-8553-03bc7db2a86b_1580x756.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!1S_g!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F25862d99-b35f-4c48-8553-03bc7db2a86b_1580x756.png" width="1456" height="697" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/25862d99-b35f-4c48-8553-03bc7db2a86b_1580x756.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:697,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:110852,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!1S_g!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F25862d99-b35f-4c48-8553-03bc7db2a86b_1580x756.png 424w, https://substackcdn.com/image/fetch/$s_!1S_g!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F25862d99-b35f-4c48-8553-03bc7db2a86b_1580x756.png 848w, https://substackcdn.com/image/fetch/$s_!1S_g!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F25862d99-b35f-4c48-8553-03bc7db2a86b_1580x756.png 1272w, https://substackcdn.com/image/fetch/$s_!1S_g!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F25862d99-b35f-4c48-8553-03bc7db2a86b_1580x756.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>I wish them luck and hope their platform stays developer-focused and reliable.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.fikisipi.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading fikisipi! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-1" href="#footnote-anchor-1" class="footnote-number" contenteditable="false" target="_self">1</a><div class="footnote-content"><p>Here&#8217;s how even the simplest SageMaker GPU configuration looks like: <a href="https://github.com/aws/amazon-sagemaker-examples/blob/main/sagemaker-inference-deployment-guardrails/Update-SageMaker-Inference-endpoint-using-rolling-deployment.ipynb">https://github.com/aws/amazon-sagemaker-examples/blob/main/sagemaker-inference-deployment-guardrails/Update-SageMaker-Inference-endpoint-using-rolling-deployment.ipynb</a> &#8230; and this doesn&#8217;t include all the S3+build configs to ship a pretrained model.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-2" href="#footnote-anchor-2" class="footnote-number" contenteditable="false" target="_self">2</a><div class="footnote-content"><p>Although giving up on AWS SageMaker was a good idea, before completely giving up on AWS we should have considered raw AWS Elastic Containers with a GPU attached. I&#8217;m assuming that&#8217;s one of the ways Modal manages to run models internally.</p></div></div>]]></content:encoded></item><item><title><![CDATA[The game theoretic poll that made Twitter users angry]]></title><description><![CDATA[Picking red or blue caused users to block each other and study game theory]]></description><link>https://www.fikisipi.com/p/the-puzzling-poll-that-made-many</link><guid isPermaLink="false">https://www.fikisipi.com/p/the-puzzling-poll-that-made-many</guid><dc:creator><![CDATA[Filip Dimitrovski]]></dc:creator><pubDate>Tue, 15 Aug 2023 19:46:18 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/8564f44d-fdf8-49da-a3c6-8789260e002d_600x429.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Ojlf!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37d254cf-8278-43ae-8769-abd565a580a3_1178x756.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Ojlf!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37d254cf-8278-43ae-8769-abd565a580a3_1178x756.png 424w, https://substackcdn.com/image/fetch/$s_!Ojlf!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37d254cf-8278-43ae-8769-abd565a580a3_1178x756.png 848w, https://substackcdn.com/image/fetch/$s_!Ojlf!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37d254cf-8278-43ae-8769-abd565a580a3_1178x756.png 1272w, https://substackcdn.com/image/fetch/$s_!Ojlf!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37d254cf-8278-43ae-8769-abd565a580a3_1178x756.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Ojlf!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37d254cf-8278-43ae-8769-abd565a580a3_1178x756.png" width="1178" height="756" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/37d254cf-8278-43ae-8769-abd565a580a3_1178x756.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:756,&quot;width&quot;:1178,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:177187,&quot;alt&quot;:&quot;Poll question from my 12yo:  Everyone responding to this poll chooses between a blue pill or red pill.  - if > 50% of ppl choose blue pill, everyone lives - if not, red pills live and blue pills die  Which do you choose?&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Poll question from my 12yo:  Everyone responding to this poll chooses between a blue pill or red pill.  - if > 50% of ppl choose blue pill, everyone lives - if not, red pills live and blue pills die  Which do you choose?" title="Poll question from my 12yo:  Everyone responding to this poll chooses between a blue pill or red pill.  - if > 50% of ppl choose blue pill, everyone lives - if not, red pills live and blue pills die  Which do you choose?" srcset="https://substackcdn.com/image/fetch/$s_!Ojlf!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37d254cf-8278-43ae-8769-abd565a580a3_1178x756.png 424w, https://substackcdn.com/image/fetch/$s_!Ojlf!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37d254cf-8278-43ae-8769-abd565a580a3_1178x756.png 848w, https://substackcdn.com/image/fetch/$s_!Ojlf!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37d254cf-8278-43ae-8769-abd565a580a3_1178x756.png 1272w, https://substackcdn.com/image/fetch/$s_!Ojlf!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37d254cf-8278-43ae-8769-abd565a580a3_1178x756.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>On August the 14th, Twitter user <a href="https://twitter.com/lisatomic5">lisatomic</a> posted the poll above. Just like the movie <a href="https://en.wikipedia.org/wiki/The_Matrix">The Matrix</a>, your job is to pick a red or blue pill &#8212; but this time it doesn&#8217;t look like the choice involves learning the truth about the universe. Or, that&#8217;s how it looks at first glance. It&#8217;s just a logic puzzle that involves survival.</p><div><hr></div><p>The tweet containing the poll quickly gained thousands of retweets. Users familiar with mathematical puzzles noticed its similarity to the <a href="https://en.wikipedia.org/wiki/Prisoner%27s_dilemma">Prisoner&#8217;s dilemma.</a> The poll, as well as the aforementioned dilemma are part of game theory, a branch of mathematics that studies strategic choices of two or more entities playing any game with well-defined rules.</p><p>If we want to find the optimal choice, we want to analyse the cost and benefit of each choice, while taking into account that other players are rational and will analyse the cost and benefit before making their choice too.</p><p>If we assume others are rational, they want to live &#8212; and the blue pill offers a world where you live <em>as long as the majority picks it</em>. On first hand, this sounds like a good idea, and that&#8217;s what over 64% of people did:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!FnIo!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e52718f-bc1b-4b01-b7ec-0157006614d3_1182x950.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!FnIo!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e52718f-bc1b-4b01-b7ec-0157006614d3_1182x950.png 424w, https://substackcdn.com/image/fetch/$s_!FnIo!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e52718f-bc1b-4b01-b7ec-0157006614d3_1182x950.png 848w, https://substackcdn.com/image/fetch/$s_!FnIo!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e52718f-bc1b-4b01-b7ec-0157006614d3_1182x950.png 1272w, https://substackcdn.com/image/fetch/$s_!FnIo!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e52718f-bc1b-4b01-b7ec-0157006614d3_1182x950.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!FnIo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e52718f-bc1b-4b01-b7ec-0157006614d3_1182x950.png" width="1182" height="950" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2e52718f-bc1b-4b01-b7ec-0157006614d3_1182x950.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:950,&quot;width&quot;:1182,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:148582,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!FnIo!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e52718f-bc1b-4b01-b7ec-0157006614d3_1182x950.png 424w, https://substackcdn.com/image/fetch/$s_!FnIo!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e52718f-bc1b-4b01-b7ec-0157006614d3_1182x950.png 848w, https://substackcdn.com/image/fetch/$s_!FnIo!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e52718f-bc1b-4b01-b7ec-0157006614d3_1182x950.png 1272w, https://substackcdn.com/image/fetch/$s_!FnIo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e52718f-bc1b-4b01-b7ec-0157006614d3_1182x950.png 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong>So we saved everyone, with a safety margin of 14.9%!</strong></p><p>&#8230; But we are talking about <em>life and death</em>, and if you&#8217;ve read the Prisoner&#8217;s dilemma you know that strategic choices are nuanced, and in some cases the optimal personal choice is to betray everyone even though cooperation saves everyone.</p><p>In particular, users noticed the following fact: <strong>there is no case where a red pill dies</strong>. </p><ul><li><p>If the majority of users pick red, all reds survive.</p></li><li><p>If the majority of users pick blue, everyone survives &#8594; all reds survive</p></li></ul><p>It&#8217;s a fail-safe option. If everyone takes the fail-safe option, everyone is safe regardless of how manipulative and destructive others are.</p><p>At this point, people started arguing, with some blocking each other: how come it feels right to pick blue if it&#8217;s so wrong? Some lost faith in humanity and <a href="https://twitter.com/DavidDeutschOxf/status/1691079165431156736">physicist David Deutsch remarked</a> that it&#8217;s a gotcha question that involves skill that isn&#8217;t taught very often:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://twitter.com/DavidDeutschOxf/status/1691079165431156736" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!2522!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb7ae94a7-122c-4b63-9b43-1f2a9bf5bc5a_1248x1416.png 424w, https://substackcdn.com/image/fetch/$s_!2522!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb7ae94a7-122c-4b63-9b43-1f2a9bf5bc5a_1248x1416.png 848w, https://substackcdn.com/image/fetch/$s_!2522!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb7ae94a7-122c-4b63-9b43-1f2a9bf5bc5a_1248x1416.png 1272w, https://substackcdn.com/image/fetch/$s_!2522!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb7ae94a7-122c-4b63-9b43-1f2a9bf5bc5a_1248x1416.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!2522!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb7ae94a7-122c-4b63-9b43-1f2a9bf5bc5a_1248x1416.png" width="496" height="562.7692307692307" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b7ae94a7-122c-4b63-9b43-1f2a9bf5bc5a_1248x1416.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1416,&quot;width&quot;:1248,&quot;resizeWidth&quot;:496,&quot;bytes&quot;:291061,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://twitter.com/DavidDeutschOxf/status/1691079165431156736&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!2522!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb7ae94a7-122c-4b63-9b43-1f2a9bf5bc5a_1248x1416.png 424w, https://substackcdn.com/image/fetch/$s_!2522!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb7ae94a7-122c-4b63-9b43-1f2a9bf5bc5a_1248x1416.png 848w, https://substackcdn.com/image/fetch/$s_!2522!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb7ae94a7-122c-4b63-9b43-1f2a9bf5bc5a_1248x1416.png 1272w, https://substackcdn.com/image/fetch/$s_!2522!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb7ae94a7-122c-4b63-9b43-1f2a9bf5bc5a_1248x1416.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>But there&#8217;s another point that needs to be made: game theory doesn&#8217;t involve mis-clicks, misreading the question, or the guilt of killing your grandma that chose the supposedly non-optimal blue. These social effects make a lot of sense in the altruistic camp:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://twitter.com/besttrousers/status/1691094639296798720" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!xjMt!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93fd0e33-4184-4413-b99f-935852c21ecb_1196x788.png 424w, https://substackcdn.com/image/fetch/$s_!xjMt!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93fd0e33-4184-4413-b99f-935852c21ecb_1196x788.png 848w, https://substackcdn.com/image/fetch/$s_!xjMt!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93fd0e33-4184-4413-b99f-935852c21ecb_1196x788.png 1272w, https://substackcdn.com/image/fetch/$s_!xjMt!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93fd0e33-4184-4413-b99f-935852c21ecb_1196x788.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!xjMt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93fd0e33-4184-4413-b99f-935852c21ecb_1196x788.png" width="1196" height="788" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/93fd0e33-4184-4413-b99f-935852c21ecb_1196x788.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:788,&quot;width&quot;:1196,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:148948,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://twitter.com/besttrousers/status/1691094639296798720&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!xjMt!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93fd0e33-4184-4413-b99f-935852c21ecb_1196x788.png 424w, https://substackcdn.com/image/fetch/$s_!xjMt!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93fd0e33-4184-4413-b99f-935852c21ecb_1196x788.png 848w, https://substackcdn.com/image/fetch/$s_!xjMt!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93fd0e33-4184-4413-b99f-935852c21ecb_1196x788.png 1272w, https://substackcdn.com/image/fetch/$s_!xjMt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93fd0e33-4184-4413-b99f-935852c21ecb_1196x788.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The Canadian singer Grimes and the game designer Jonathan Blow think the final results 64.9% - 35.1% might not reflect reality:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!h4Rq!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F607b0692-69d7-4b5f-9f0d-6b15a1467cc1_1196x534.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!h4Rq!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F607b0692-69d7-4b5f-9f0d-6b15a1467cc1_1196x534.png 424w, https://substackcdn.com/image/fetch/$s_!h4Rq!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F607b0692-69d7-4b5f-9f0d-6b15a1467cc1_1196x534.png 848w, https://substackcdn.com/image/fetch/$s_!h4Rq!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F607b0692-69d7-4b5f-9f0d-6b15a1467cc1_1196x534.png 1272w, https://substackcdn.com/image/fetch/$s_!h4Rq!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F607b0692-69d7-4b5f-9f0d-6b15a1467cc1_1196x534.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!h4Rq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F607b0692-69d7-4b5f-9f0d-6b15a1467cc1_1196x534.png" width="498" height="222.35117056856188" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/607b0692-69d7-4b5f-9f0d-6b15a1467cc1_1196x534.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:534,&quot;width&quot;:1196,&quot;resizeWidth&quot;:498,&quot;bytes&quot;:108388,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!h4Rq!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F607b0692-69d7-4b5f-9f0d-6b15a1467cc1_1196x534.png 424w, https://substackcdn.com/image/fetch/$s_!h4Rq!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F607b0692-69d7-4b5f-9f0d-6b15a1467cc1_1196x534.png 848w, https://substackcdn.com/image/fetch/$s_!h4Rq!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F607b0692-69d7-4b5f-9f0d-6b15a1467cc1_1196x534.png 1272w, https://substackcdn.com/image/fetch/$s_!h4Rq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F607b0692-69d7-4b5f-9f0d-6b15a1467cc1_1196x534.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!oAj_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08963ca7-bef7-456c-8bbb-4c9e567675c1_1192x1314.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!oAj_!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08963ca7-bef7-456c-8bbb-4c9e567675c1_1192x1314.png 424w, https://substackcdn.com/image/fetch/$s_!oAj_!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08963ca7-bef7-456c-8bbb-4c9e567675c1_1192x1314.png 848w, https://substackcdn.com/image/fetch/$s_!oAj_!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08963ca7-bef7-456c-8bbb-4c9e567675c1_1192x1314.png 1272w, https://substackcdn.com/image/fetch/$s_!oAj_!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08963ca7-bef7-456c-8bbb-4c9e567675c1_1192x1314.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!oAj_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08963ca7-bef7-456c-8bbb-4c9e567675c1_1192x1314.png" width="458" height="504.8758389261745" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/08963ca7-bef7-456c-8bbb-4c9e567675c1_1192x1314.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1314,&quot;width&quot;:1192,&quot;resizeWidth&quot;:458,&quot;bytes&quot;:242098,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!oAj_!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08963ca7-bef7-456c-8bbb-4c9e567675c1_1192x1314.png 424w, https://substackcdn.com/image/fetch/$s_!oAj_!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08963ca7-bef7-456c-8bbb-4c9e567675c1_1192x1314.png 848w, https://substackcdn.com/image/fetch/$s_!oAj_!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08963ca7-bef7-456c-8bbb-4c9e567675c1_1192x1314.png 1272w, https://substackcdn.com/image/fetch/$s_!oAj_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08963ca7-bef7-456c-8bbb-4c9e567675c1_1192x1314.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>In conclusion, this feels like the main character in Nolan&#8217;s Oppenheimer: it&#8217;s hard to articulate a coherent view when there are feelings involved. If you want to follow the latest discourse regarding this puzzle, you&#8217;d be interested in <a href="https://twitter.com/RokoMijic">Roko Mijic&#8217;s Twitter timeline</a>. If you like content like this, subscribe to the blog and <a href="https://twitter.com/fikisipi">follow me on Twitter.</a></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.fikisipi.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading fikisipi! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[If someone gives you a distance matrix, can you generate plausible (x, y) coordinate pairs?]]></title><description><![CDATA[The first thing to realize is that we are dealing with infinite solutions.]]></description><link>https://www.fikisipi.com/p/given-distances-between-cities-can</link><guid isPermaLink="false">https://www.fikisipi.com/p/given-distances-between-cities-can</guid><dc:creator><![CDATA[Filip Dimitrovski]]></dc:creator><pubDate>Thu, 11 May 2023 10:09:59 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/0043a25e-eefa-455e-a163-1878b34b933a_420x300.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Puqq!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28e091d2-735f-4a95-a7c0-a3e678284446_1546x1416.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Puqq!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28e091d2-735f-4a95-a7c0-a3e678284446_1546x1416.png 424w, https://substackcdn.com/image/fetch/$s_!Puqq!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28e091d2-735f-4a95-a7c0-a3e678284446_1546x1416.png 848w, https://substackcdn.com/image/fetch/$s_!Puqq!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28e091d2-735f-4a95-a7c0-a3e678284446_1546x1416.png 1272w, https://substackcdn.com/image/fetch/$s_!Puqq!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28e091d2-735f-4a95-a7c0-a3e678284446_1546x1416.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Puqq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28e091d2-735f-4a95-a7c0-a3e678284446_1546x1416.png" width="1456" height="1334" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/28e091d2-735f-4a95-a7c0-a3e678284446_1546x1416.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1334,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:280438,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Puqq!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28e091d2-735f-4a95-a7c0-a3e678284446_1546x1416.png 424w, https://substackcdn.com/image/fetch/$s_!Puqq!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28e091d2-735f-4a95-a7c0-a3e678284446_1546x1416.png 848w, https://substackcdn.com/image/fetch/$s_!Puqq!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28e091d2-735f-4a95-a7c0-a3e678284446_1546x1416.png 1272w, https://substackcdn.com/image/fetch/$s_!Puqq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28e091d2-735f-4a95-a7c0-a3e678284446_1546x1416.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The first thing to realize is that we are dealing with infinite solutions. If we can find a single solution (you can imagine a 2D city map), by repeatedly performing arbitrary rotations / reflections / translations (so-called <a href="https://en.wikipedia.org/wiki/Euclidean_transformation">Euclidean transformations</a>) on the city map, we change the coordinates while preserving the distances of each pair of cities and thus we never run out of novel solutions.</p><h2>The easy case: three cities</h2><p>Let&#8217;s try generating a solution for three cities. Given cities {A, B, C} and distances d(A, B), d(B, C), d(A,C) it&#8217;s easy to notice that a valid solution is the set of vertex coordinates of a triangle with edge lengths corresponding to the distances. <a href="https://flexbooks.ck12.org/cbook/ck-12-cbse-maths-class-7/section/9.2/primary/lesson/construction-of-sss-triangle/">You can use a ruler and compass</a>: any line segment A&#773;B&#773; of length d(A, B) generates the first two vertices and the intersection of two arcs centered at A and B with corresponding radiuses d(A, C) and d(B, C) will form the vertex C.</p><p>The computational approach for the 3 city problem would work like this: start with A=(0, 0) and B=(0, d(A,B)). The compass intersaction is a system of two Pythagorean theorem equations (origin to C and B to C)<a href="https://math.stackexchange.com/a/1989113"> and with a few rearrangements</a> we can compute a solution for C (note: flipping the sign on y works too - it&#8217;s an example of vertical reflection):</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!JrgZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2bdec3a4-8636-4b23-9afd-9968c8e7388c_1238x268.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!JrgZ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2bdec3a4-8636-4b23-9afd-9968c8e7388c_1238x268.png 424w, https://substackcdn.com/image/fetch/$s_!JrgZ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2bdec3a4-8636-4b23-9afd-9968c8e7388c_1238x268.png 848w, https://substackcdn.com/image/fetch/$s_!JrgZ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2bdec3a4-8636-4b23-9afd-9968c8e7388c_1238x268.png 1272w, https://substackcdn.com/image/fetch/$s_!JrgZ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2bdec3a4-8636-4b23-9afd-9968c8e7388c_1238x268.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!JrgZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2bdec3a4-8636-4b23-9afd-9968c8e7388c_1238x268.png" width="1238" height="268" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2bdec3a4-8636-4b23-9afd-9968c8e7388c_1238x268.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:268,&quot;width&quot;:1238,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:36982,&quot;alt&quot;:&quot;\\begin{gather} C_x = \\frac{d(A,B)^2+d(A,C)^2-d(B,C)^2}{d(A,B) * d(B, C)} \\\\ C_y = \\pm\\sqrt{d(A,C)^2 - C_x^2} \\end{gather}&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="\begin{gather} C_x = \frac{d(A,B)^2+d(A,C)^2-d(B,C)^2}{d(A,B) * d(B, C)} \\ C_y = \pm\sqrt{d(A,C)^2 - C_x^2} \end{gather}" title="\begin{gather} C_x = \frac{d(A,B)^2+d(A,C)^2-d(B,C)^2}{d(A,B) * d(B, C)} \\ C_y = \pm\sqrt{d(A,C)^2 - C_x^2} \end{gather}" srcset="https://substackcdn.com/image/fetch/$s_!JrgZ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2bdec3a4-8636-4b23-9afd-9968c8e7388c_1238x268.png 424w, https://substackcdn.com/image/fetch/$s_!JrgZ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2bdec3a4-8636-4b23-9afd-9968c8e7388c_1238x268.png 848w, https://substackcdn.com/image/fetch/$s_!JrgZ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2bdec3a4-8636-4b23-9afd-9968c8e7388c_1238x268.png 1272w, https://substackcdn.com/image/fetch/$s_!JrgZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2bdec3a4-8636-4b23-9afd-9968c8e7388c_1238x268.png 1456w" sizes="100vw"></picture><div></div></div></a></figure></div><h2>The general case: distance and Gram matrices</h2><p>What about thousands of cities? We need an <strong>N&#215;N matrix</strong> where each row is composed of the distances of all pairs of cities, but note that we include the distance from each city to itself too (which is obviously zero):</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!7B-0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02ab06dc-c1d7-47cb-a9d6-4f5f288f2a6a_1168x310.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!7B-0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02ab06dc-c1d7-47cb-a9d6-4f5f288f2a6a_1168x310.png 424w, https://substackcdn.com/image/fetch/$s_!7B-0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02ab06dc-c1d7-47cb-a9d6-4f5f288f2a6a_1168x310.png 848w, https://substackcdn.com/image/fetch/$s_!7B-0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02ab06dc-c1d7-47cb-a9d6-4f5f288f2a6a_1168x310.png 1272w, https://substackcdn.com/image/fetch/$s_!7B-0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02ab06dc-c1d7-47cb-a9d6-4f5f288f2a6a_1168x310.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!7B-0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02ab06dc-c1d7-47cb-a9d6-4f5f288f2a6a_1168x310.png" width="1168" height="310" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/02ab06dc-c1d7-47cb-a9d6-4f5f288f2a6a_1168x310.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:310,&quot;width&quot;:1168,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:33693,&quot;alt&quot;:&quot;\\begin{matrix} 0 &amp; \\text{d}({c_1, c_2}) &amp; \\dots &amp; \\text{d}(c_1, c_j) \\\\ \\text{d}(c_2, c_1) &amp; 0 &amp; \\dots &amp; \\text{d}(c_2, c_j) \\\\ \\vdots &amp; \\vdots &amp; \\ddots \\\\ \\text{d}(c_i, c_1) &amp; \\text{d}(c_i, c_2) &amp; \\dots &amp; 0 \\end{matrix}&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="\begin{matrix} 0 &amp; \text{d}({c_1, c_2}) &amp; \dots &amp; \text{d}(c_1, c_j) \\ \text{d}(c_2, c_1) &amp; 0 &amp; \dots &amp; \text{d}(c_2, c_j) \\ \vdots &amp; \vdots &amp; \ddots \\ \text{d}(c_i, c_1) &amp; \text{d}(c_i, c_2) &amp; \dots &amp; 0 \end{matrix}" title="\begin{matrix} 0 &amp; \text{d}({c_1, c_2}) &amp; \dots &amp; \text{d}(c_1, c_j) \\ \text{d}(c_2, c_1) &amp; 0 &amp; \dots &amp; \text{d}(c_2, c_j) \\ \vdots &amp; \vdots &amp; \ddots \\ \text{d}(c_i, c_1) &amp; \text{d}(c_i, c_2) &amp; \dots &amp; 0 \end{matrix}" srcset="https://substackcdn.com/image/fetch/$s_!7B-0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02ab06dc-c1d7-47cb-a9d6-4f5f288f2a6a_1168x310.png 424w, https://substackcdn.com/image/fetch/$s_!7B-0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02ab06dc-c1d7-47cb-a9d6-4f5f288f2a6a_1168x310.png 848w, https://substackcdn.com/image/fetch/$s_!7B-0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02ab06dc-c1d7-47cb-a9d6-4f5f288f2a6a_1168x310.png 1272w, https://substackcdn.com/image/fetch/$s_!7B-0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02ab06dc-c1d7-47cb-a9d6-4f5f288f2a6a_1168x310.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>NxN matrices are called square matrices because count(rows) = count(columns). The zeroes are the distance-to-self entries and they form the <em>diagonal of the matrix</em>. Since we are working with a square matrix of Euclidean distances, we want to check out <a href="https://en.wikipedia.org/wiki/Euclidean_distance_matrix">Euclidean distance matrices</a>. The only nitpick is that <strong>Euclidean matrices are supposed to have entries that are distances squared </strong>to simplify operations that revolve around the Pythagorean theorem. <em>That&#8217;s fine</em> - we can square each entry. Note the symmetry between an entry (i, j) and an entry (j, i): this comes from the fact that the distance from A to B = the distance from B to A.  </p><p>So now we represent the distances in an Euclidean distance matrix D, but how do we represent the solution &#8212; 2D coordinates of each city? We can make an N&#215;2 matrix (call it S) where each row represents the x and y coordinates of each city (i.e. a<em> 2D vector</em>). There isn&#8217;t a unique way to map D into S because as we said earlier, there are infinitely many solutions. The dimensions of the input D collapse during the transformation from N&#215;N to N&#215;2 - this is an example of <strong>dimensionality reduction</strong>.</p><h4>Relation to Gram matrices &amp; dot products</h4><p>Now, there are different ways of doing dimensionality reduction, depending on which geometric/statistical property you want to preserve when you reduce the dimensions. The properties mentioned in the Wiki article for Euclidean distance matrices such as symmetry and zero diagonals are useless when it comes to coordinates (o<em>ur solution matrix isn&#8217;t a square matrix at all</em>).</p><p>But scroll a bit down, and there&#8217;s <strong>one striking property</strong>, Euclidean distance matrices are related to Gram matrices: square matrices that are describing each pairwise <a href="https://en.wikipedia.org/wiki/Dot_product">dot product</a> of a set of vectors. A dot product v&#8321; &#8901; v2 is summing the pairwise products of all their coordinates: v1 &#8901; v2 = v1&#8339; &#215; v2&#8339; + v1&#7527; &#215; v2&#7527;. We can easily see that a dot product of v to itself v &#8901; v is x&#178; + y&#178;. That&#8217;s <em>the length of v squared</em> (let&#8217;s also use ||v|| to represent the length of the vector, <em>also called magnitude</em>).</p><p>The geometric interpretation is that v1 &#8901; v2 = ||v1|| &#215; ||v2|| &#215; cos&#952;. So the entries entries of a Gram matrix G are of form g(i, j) = ||v_i|| &#215; ||v_j|| &#215; cos(&#952;), where &#952; is the angle between v_i and v_j. Thus, by storing pairwise dot products, we indirectly store the length and angle of each vector.</p><p>The proven relation between D=d(i, j)&#178; and G=g(i, j) is quite trivial addition and substraction:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!deJd!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f8313e5-7782-405e-b2dc-afe7e9592080_1246x320.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!deJd!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f8313e5-7782-405e-b2dc-afe7e9592080_1246x320.png 424w, https://substackcdn.com/image/fetch/$s_!deJd!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f8313e5-7782-405e-b2dc-afe7e9592080_1246x320.png 848w, https://substackcdn.com/image/fetch/$s_!deJd!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f8313e5-7782-405e-b2dc-afe7e9592080_1246x320.png 1272w, https://substackcdn.com/image/fetch/$s_!deJd!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f8313e5-7782-405e-b2dc-afe7e9592080_1246x320.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!deJd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f8313e5-7782-405e-b2dc-afe7e9592080_1246x320.png" width="1246" height="320" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1f8313e5-7782-405e-b2dc-afe7e9592080_1246x320.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:320,&quot;width&quot;:1246,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:37600,&quot;alt&quot;:&quot;\\begin{gather} g_{ij}= \\| v_i \\| \\| v_j \\| cos(\\theta)  =\\\\  \\frac {(\\|d_{i}-d_{1}\\|^{2}+\\|d_{j}-x_{1}\\|^{2}-\\|d_{i}-d_{j}\\|^{2})}{2} \\\\ ={\\frac {1}{2}}(d_{1i}^{2}+d_{1j}^{2}-d_{ij}^{2}) \\end{gather}&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="\begin{gather} g_{ij}= \| v_i \| \| v_j \| cos(\theta)  =\\  \frac {(\|d_{i}-d_{1}\|^{2}+\|d_{j}-x_{1}\|^{2}-\|d_{i}-d_{j}\|^{2})}{2} \\ ={\frac {1}{2}}(d_{1i}^{2}+d_{1j}^{2}-d_{ij}^{2}) \end{gather}" title="\begin{gather} g_{ij}= \| v_i \| \| v_j \| cos(\theta)  =\\  \frac {(\|d_{i}-d_{1}\|^{2}+\|d_{j}-x_{1}\|^{2}-\|d_{i}-d_{j}\|^{2})}{2} \\ ={\frac {1}{2}}(d_{1i}^{2}+d_{1j}^{2}-d_{ij}^{2}) \end{gather}" srcset="https://substackcdn.com/image/fetch/$s_!deJd!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f8313e5-7782-405e-b2dc-afe7e9592080_1246x320.png 424w, https://substackcdn.com/image/fetch/$s_!deJd!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f8313e5-7782-405e-b2dc-afe7e9592080_1246x320.png 848w, https://substackcdn.com/image/fetch/$s_!deJd!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f8313e5-7782-405e-b2dc-afe7e9592080_1246x320.png 1272w, https://substackcdn.com/image/fetch/$s_!deJd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f8313e5-7782-405e-b2dc-afe7e9592080_1246x320.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4>Turning a Gram matrix into a set of points</h4><p>The <a href="https://en.wikipedia.org/wiki/Gram_matrix#Finding_a_vector_realization">&#8220;Finding a vector realization&#8221;</a> section further down is what we need, but it&#8217;s a bit convoluted since it also considers complex vectors. <em>In any case</em>, it says several <em>decomposition techniques</em> of G can produce the N&#215;2 final result.</p><p>Now, explaining matrix decomposition techniques and performing them by hand will require a lot of practice with matrix multiplication, transposes, eigenvectors, but fortunately we can use any numeric computing language/library to do it for us. I chose Sage (which can execute on Web) and SVD decomposition:</p><pre><code>N = 4

# note 1: Sage indices are 0..N-1 instead of 1..N
# so we gotta be careful.

# distance matrix.
# note 2: the given distances are not squared
D = matrix([[ 0, 3, 10, 1 ],
            [ 3, 0, 5, 4 ],
            [ 10, 5, 0, 11 ],
            [ 1, 4, 11, 0 ]
          ])

# calculate Gram matrix G as follows:
# g_ij = 1/2 * ( (d_0i)^2 + (d_0j)^2 - (d_ij)^2)

G = matrix(N, N, lambda i, j: (D[0, i] ** 2 + D[0, j] ** 2 - D[i, j] ** 2) / 2)

# SVD of a Gram matrix gives us U * S * U^t
# a possible solution is the product U * &#8730;S,
# where the x, y coords of each row are the first two columns
 
U, S, UT = matrix(RDF, G).SVD()

(U * S.apply_map(lambda el: sqrt(el))).matrix_from_columns([0, 1])</code></pre><p>If you run it on <a href="https://sagecell.sagemath.org/">https://sagecell.sagemath.org/</a> you get a possible solution:</p><pre><code>[                0.0                 0.0]
[  -3.92291410062551   2.528288457959308]
[-10.051441221192283 -1.0157568878859065]
[  0.965029794343825 -0.3021276784799517]</code></pre><p>You can check whether this is a valid solution by computing the distances. I got +-15% inaccuracies; presumably because of the square roots and SVD approximations.</p>]]></content:encoded></item></channel></rss>