{
  "version": "https://jsonfeed.org/version/1.1",
  "title": "Ramith Hettiarachchi — Scholarly Posts",
  "description": "Curated research notes, scholarly explainers, and independent findings.",
  "user_comment": "This is the blog's curated full-text scholarly feed.",
  "home_page_url": "https://ramith.fyi/",
  "feed_url": "https://ramith.fyi/feed.json",
  "language": "en",
  "authors": [
    {
      "name": "Ramith Hettiarachchi",
      "url": "https://ramith.fyi/"
    }
  ],
  "items": [
    {
      "id": "https://ramith.fyi/posts/2026-10-24-optimizing-alphafold3-single-seq-mode-for-tpus/",
      "url": "https://ramith.fyi/posts/2026-10-24-optimizing-alphafold3-single-seq-mode-for-tpus/",
      "title": "Running AlphaFold3 (single seq mode) 3 times faster on TPUs",
      "content_html": "<h2>Running AlphaFold3 (single seq mode) 3 times faster on TPUs</h2><div data-title=\"Running AlphaFold3 (single seq mode) 3 times faster on TPUs\" data-slug=\"2026-10-24-optimizing-alphafold3-single-seq-mode-for-tpus\" data-authors=\"Ramith Hettiarachchi\" data-date-published=\"2026-10-24\" data-language=\"en\" data-status=\"published\" data-license=\"CC-BY-4.0\" data-collections=\"scholarly\" data-doi=\"\"><p>By Ramith Hettiarachchi ⋅ Published <time datetime=\"2026-10-24\">2026-10-24</time></p></div><p><img src=\"https://ramith.fyi/assets/posts/2026-10-24-optimizing-alphafold3-single-seq-mode-for-tpus/cover-trillium.jpg\" alt=\"Google&#x27;s Trillium (6th-generation TPU) keynote slide\" hidden=\"hidden\"></p><style>.hw-term { --hw-a: 0.8; --hw-g: rgba(170, 170, 170, var(--hw-a)), rgba(170, 170, 170, var(--hw-a)); border-radius: 2px; padding: 0 0.06em; cursor: help; outline: none; background-image: linear-gradient(90deg, var(--hw-g)); background-repeat: no-repeat; background-position: 0 100%; background-size: 100% 42%; transition: background-size 160ms ease-out; } @media (prefers-color-scheme: dark) { .hw-term { --hw-a: 0.45; } } .hw-term:hover, .hw-term:focus { background-size: 100% 100%; } :root { --hw-glow: rgba(0, 0, 0, 0.3); } @media (prefers-color-scheme: dark) { :root { --hw-glow: rgba(255, 255, 255, 0.6); } } .tldr-bar[data-part], .fold-bar[data-part] { transition: outline-color 120ms, box-shadow 120ms; outline: 0 solid transparent; outline-offset: 2px; } body:has(.hw-term[data-part~=&quot;v6e-stock&quot;]:is(:hover, :focus)) [data-part~=&quot;v6e-stock&quot;]:not(.hw-term) { outline: 2.5px solid currentColor; box-shadow: 0 0 8px var(--hw-glow); } body:has([data-part~=&quot;v6e-stock&quot;]:not(.hw-term):hover) [data-part~=&quot;v6e-stock&quot;]:not(.hw-term) { outline: 2.5px solid currentColor; box-shadow: 0 0 8px var(--hw-glow); } body:has([data-part~=&quot;v6e-stock&quot;]:not(.hw-term):hover) .hw-term[data-part~=&quot;v6e-stock&quot;] { background-size: 100% 100%; } body:has(.hw-term[data-part~=&quot;v6e-pipe&quot;]:is(:hover, :focus)) [data-part~=&quot;v6e-pipe&quot;]:not(.hw-term) { outline: 2.5px solid currentColor; box-shadow: 0 0 8px var(--hw-glow); } body:has([data-part~=&quot;v6e-pipe&quot;]:not(.hw-term):hover) [data-part~=&quot;v6e-pipe&quot;]:not(.hw-term) { outline: 2.5px solid currentColor; box-shadow: 0 0 8px var(--hw-glow); } body:has([data-part~=&quot;v6e-pipe&quot;]:not(.hw-term):hover) .hw-term[data-part~=&quot;v6e-pipe&quot;] { background-size: 100% 100%; } body:has(.hw-term[data-part~=&quot;v6e-pallas&quot;]:is(:hover, :focus)) [data-part~=&quot;v6e-pallas&quot;]:not(.hw-term) { outline: 2.5px solid currentColor; box-shadow: 0 0 8px var(--hw-glow); } body:has([data-part~=&quot;v6e-pallas&quot;]:not(.hw-term):hover) [data-part~=&quot;v6e-pallas&quot;]:not(.hw-term) { outline: 2.5px solid currentColor; box-shadow: 0 0 8px var(--hw-glow); } body:has([data-part~=&quot;v6e-pallas&quot;]:not(.hw-term):hover) .hw-term[data-part~=&quot;v6e-pallas&quot;] { background-size: 100% 100%; } body:has(.hw-term[data-part~=&quot;v6e-pad&quot;]:is(:hover, :focus)) [data-part~=&quot;v6e-pad&quot;]:not(.hw-term) { outline: 2.5px solid currentColor; box-shadow: 0 0 8px var(--hw-glow); } body:has([data-part~=&quot;v6e-pad&quot;]:not(.hw-term):hover) [data-part~=&quot;v6e-pad&quot;]:not(.hw-term) { outline: 2.5px solid currentColor; box-shadow: 0 0 8px var(--hw-glow); } body:has([data-part~=&quot;v6e-pad&quot;]:not(.hw-term):hover) .hw-term[data-part~=&quot;v6e-pad&quot;] { background-size: 100% 100%; } body:has(.hw-term[data-part~=&quot;5090-stock&quot;]:is(:hover, :focus)) [data-part~=&quot;5090-stock&quot;]:not(.hw-term) { outline: 2.5px solid currentColor; box-shadow: 0 0 8px var(--hw-glow); } body:has([data-part~=&quot;5090-stock&quot;]:not(.hw-term):hover) [data-part~=&quot;5090-stock&quot;]:not(.hw-term) { outline: 2.5px solid currentColor; box-shadow: 0 0 8px var(--hw-glow); } body:has([data-part~=&quot;5090-stock&quot;]:not(.hw-term):hover) .hw-term[data-part~=&quot;5090-stock&quot;] { background-size: 100% 100%; } body:has(.hw-term[data-part~=&quot;5090-xla&quot;]:is(:hover, :focus)) [data-part~=&quot;5090-xla&quot;]:not(.hw-term) { outline: 2.5px solid currentColor; box-shadow: 0 0 8px var(--hw-glow); } body:has([data-part~=&quot;5090-xla&quot;]:not(.hw-term):hover) [data-part~=&quot;5090-xla&quot;]:not(.hw-term) { outline: 2.5px solid currentColor; box-shadow: 0 0 8px var(--hw-glow); } body:has([data-part~=&quot;5090-xla&quot;]:not(.hw-term):hover) .hw-term[data-part~=&quot;5090-xla&quot;] { background-size: 100% 100%; } body:has(.hw-term[data-part~=&quot;5090-pipe&quot;]:is(:hover, :focus)) [data-part~=&quot;5090-pipe&quot;]:not(.hw-term) { outline: 2.5px solid currentColor; box-shadow: 0 0 8px var(--hw-glow); } body:has([data-part~=&quot;5090-pipe&quot;]:not(.hw-term):hover) [data-part~=&quot;5090-pipe&quot;]:not(.hw-term) { outline: 2.5px solid currentColor; box-shadow: 0 0 8px var(--hw-glow); } body:has([data-part~=&quot;5090-pipe&quot;]:not(.hw-term):hover) .hw-term[data-part~=&quot;5090-pipe&quot;] { background-size: 100% 100%; } body:has(.hw-term[data-part~=&quot;5090-pad&quot;]:is(:hover, :focus)) [data-part~=&quot;5090-pad&quot;]:not(.hw-term) { outline: 2.5px solid currentColor; box-shadow: 0 0 8px var(--hw-glow); } body:has([data-part~=&quot;5090-pad&quot;]:not(.hw-term):hover) [data-part~=&quot;5090-pad&quot;]:not(.hw-term) { outline: 2.5px solid currentColor; box-shadow: 0 0 8px var(--hw-glow); } body:has([data-part~=&quot;5090-pad&quot;]:not(.hw-term):hover) .hw-term[data-part~=&quot;5090-pad&quot;] { background-size: 100% 100%; } body:has(.hw-term[data-part~=&quot;h100-stock&quot;]:is(:hover, :focus)) [data-part~=&quot;h100-stock&quot;]:not(.hw-term) { outline: 2.5px solid currentColor; box-shadow: 0 0 8px var(--hw-glow); } body:has([data-part~=&quot;h100-stock&quot;]:not(.hw-term):hover) [data-part~=&quot;h100-stock&quot;]:not(.hw-term) { outline: 2.5px solid currentColor; box-shadow: 0 0 8px var(--hw-glow); } body:has([data-part~=&quot;h100-stock&quot;]:not(.hw-term):hover) .hw-term[data-part~=&quot;h100-stock&quot;] { background-size: 100% 100%; } body:has(.hw-term[data-part~=&quot;h100-pipe&quot;]:is(:hover, :focus)) [data-part~=&quot;h100-pipe&quot;]:not(.hw-term) { outline: 2.5px solid currentColor; box-shadow: 0 0 8px var(--hw-glow); } body:has([data-part~=&quot;h100-pipe&quot;]:not(.hw-term):hover) [data-part~=&quot;h100-pipe&quot;]:not(.hw-term) { outline: 2.5px solid currentColor; box-shadow: 0 0 8px var(--hw-glow); } body:has([data-part~=&quot;h100-pipe&quot;]:not(.hw-term):hover) .hw-term[data-part~=&quot;h100-pipe&quot;] { background-size: 100% 100%; } body:has(.hw-term[data-part~=&quot;h100-pad&quot;]:is(:hover, :focus)) [data-part~=&quot;h100-pad&quot;]:not(.hw-term) { outline: 2.5px solid currentColor; box-shadow: 0 0 8px var(--hw-glow); } body:has([data-part~=&quot;h100-pad&quot;]:not(.hw-term):hover) [data-part~=&quot;h100-pad&quot;]:not(.hw-term) { outline: 2.5px solid currentColor; box-shadow: 0 0 8px var(--hw-glow); } body:has([data-part~=&quot;h100-pad&quot;]:not(.hw-term):hover) .hw-term[data-part~=&quot;h100-pad&quot;] { background-size: 100% 100%; } .pl-svg text, .hd-svg text { pointer-events: none; } body:has(.hw-term[data-part~=&quot;pl-stock-feat&quot;]:is(:hover, :focus)) svg [data-part~=&quot;pl-stock-feat&quot;] { stroke: currentColor; stroke-width: 3.5px; filter: drop-shadow(0 0 5px var(--hw-glow)); } body:has(svg [data-part~=&quot;pl-stock-feat&quot;]:hover) svg [data-part~=&quot;pl-stock-feat&quot;] { stroke: currentColor; stroke-width: 3.5px; filter: drop-shadow(0 0 5px var(--hw-glow)); } body:has(svg [data-part~=&quot;pl-stock-feat&quot;]:hover) .hw-term[data-part~=&quot;pl-stock-feat&quot;] { background-size: 100% 100%; } body:has(.hw-term[data-part~=&quot;pl-pipe-feat&quot;]:is(:hover, :focus)) svg [data-part~=&quot;pl-pipe-feat&quot;] { stroke: currentColor; stroke-width: 3.5px; filter: drop-shadow(0 0 5px var(--hw-glow)); } body:has(svg [data-part~=&quot;pl-pipe-feat&quot;]:hover) svg [data-part~=&quot;pl-pipe-feat&quot;] { stroke: currentColor; stroke-width: 3.5px; filter: drop-shadow(0 0 5px var(--hw-glow)); } body:has(svg [data-part~=&quot;pl-pipe-feat&quot;]:hover) .hw-term[data-part~=&quot;pl-pipe-feat&quot;] { background-size: 100% 100%; } body:has(.hw-term[data-part~=&quot;pl-stock-tpu&quot;]:is(:hover, :focus)) svg [data-part~=&quot;pl-stock-tpu&quot;] { stroke: currentColor; stroke-width: 3.5px; filter: drop-shadow(0 0 5px var(--hw-glow)); } body:has(svg [data-part~=&quot;pl-stock-tpu&quot;]:hover) svg [data-part~=&quot;pl-stock-tpu&quot;] { stroke: currentColor; stroke-width: 3.5px; filter: drop-shadow(0 0 5px var(--hw-glow)); } body:has(svg [data-part~=&quot;pl-stock-tpu&quot;]:hover) .hw-term[data-part~=&quot;pl-stock-tpu&quot;] { background-size: 100% 100%; } body:has(.hw-term[data-part~=&quot;pl-pipe-tpu&quot;]:is(:hover, :focus)) svg [data-part~=&quot;pl-pipe-tpu&quot;] { stroke: currentColor; stroke-width: 3.5px; filter: drop-shadow(0 0 5px var(--hw-glow)); } body:has(svg [data-part~=&quot;pl-pipe-tpu&quot;]:hover) svg [data-part~=&quot;pl-pipe-tpu&quot;] { stroke: currentColor; stroke-width: 3.5px; filter: drop-shadow(0 0 5px var(--hw-glow)); } body:has(svg [data-part~=&quot;pl-pipe-tpu&quot;]:hover) .hw-term[data-part~=&quot;pl-pipe-tpu&quot;] { background-size: 100% 100%; } body:has(.hw-term[data-part~=&quot;pl-stock-out&quot;]:is(:hover, :focus)) svg [data-part~=&quot;pl-stock-out&quot;] { stroke: currentColor; stroke-width: 3.5px; filter: drop-shadow(0 0 5px var(--hw-glow)); } body:has(svg [data-part~=&quot;pl-stock-out&quot;]:hover) svg [data-part~=&quot;pl-stock-out&quot;] { stroke: currentColor; stroke-width: 3.5px; filter: drop-shadow(0 0 5px var(--hw-glow)); } body:has(svg [data-part~=&quot;pl-stock-out&quot;]:hover) .hw-term[data-part~=&quot;pl-stock-out&quot;] { background-size: 100% 100%; } body:has(.hw-term[data-part~=&quot;pl-pipe-out&quot;]:is(:hover, :focus)) svg [data-part~=&quot;pl-pipe-out&quot;] { stroke: currentColor; stroke-width: 3.5px; filter: drop-shadow(0 0 5px var(--hw-glow)); } body:has(svg [data-part~=&quot;pl-pipe-out&quot;]:hover) svg [data-part~=&quot;pl-pipe-out&quot;] { stroke: currentColor; stroke-width: 3.5px; filter: drop-shadow(0 0 5px var(--hw-glow)); } body:has(svg [data-part~=&quot;pl-pipe-out&quot;]:hover) .hw-term[data-part~=&quot;pl-pipe-out&quot;] { background-size: 100% 100%; } body:has(.hw-term[data-part~=&quot;hd-trunk&quot;]:is(:hover, :focus)) svg [data-part~=&quot;hd-trunk&quot;] { stroke: currentColor; stroke-width: 3.5px; filter: drop-shadow(0 0 5px var(--hw-glow)); } body:has(svg [data-part~=&quot;hd-trunk&quot;]:hover) svg [data-part~=&quot;hd-trunk&quot;] { stroke: currentColor; stroke-width: 3.5px; filter: drop-shadow(0 0 5px var(--hw-glow)); } body:has(svg [data-part~=&quot;hd-trunk&quot;]:hover) .hw-term[data-part~=&quot;hd-trunk&quot;] { background-size: 100% 100%; } body:has(.hw-term[data-part~=&quot;hd-loop&quot;]:is(:hover, :focus)) svg [data-part~=&quot;hd-loop&quot;] { stroke: currentColor; stroke-width: 3.5px; filter: drop-shadow(0 0 5px var(--hw-glow)); } body:has(svg [data-part~=&quot;hd-loop&quot;]:hover) svg [data-part~=&quot;hd-loop&quot;] { stroke: currentColor; stroke-width: 3.5px; filter: drop-shadow(0 0 5px var(--hw-glow)); } body:has(svg [data-part~=&quot;hd-loop&quot;]:hover) .hw-term[data-part~=&quot;hd-loop&quot;] { background-size: 100% 100%; } body:has(.hw-term[data-part~=&quot;hd-encoder&quot;]:is(:hover, :focus)) svg [data-part~=&quot;hd-encoder&quot;] { stroke: currentColor; stroke-width: 3.5px; filter: drop-shadow(0 0 5px var(--hw-glow)); } body:has(svg [data-part~=&quot;hd-encoder&quot;]:hover) svg [data-part~=&quot;hd-encoder&quot;] { stroke: currentColor; stroke-width: 3.5px; filter: drop-shadow(0 0 5px var(--hw-glow)); } body:has(svg [data-part~=&quot;hd-encoder&quot;]:hover) .hw-term[data-part~=&quot;hd-encoder&quot;] { background-size: 100% 100%; } body:has(.hw-term[data-part~=&quot;hd-transformer&quot;]:is(:hover, :focus)) svg [data-part~=&quot;hd-transformer&quot;] { stroke: currentColor; stroke-width: 3.5px; filter: drop-shadow(0 0 5px var(--hw-glow)); } body:has(svg [data-part~=&quot;hd-transformer&quot;]:hover) svg [data-part~=&quot;hd-transformer&quot;] { stroke: currentColor; stroke-width: 3.5px; filter: drop-shadow(0 0 5px var(--hw-glow)); } body:has(svg [data-part~=&quot;hd-transformer&quot;]:hover) .hw-term[data-part~=&quot;hd-transformer&quot;] { background-size: 100% 100%; } body:has(.hw-term[data-part~=&quot;hd-decoder&quot;]:is(:hover, :focus)) svg [data-part~=&quot;hd-decoder&quot;] { stroke: currentColor; stroke-width: 3.5px; filter: drop-shadow(0 0 5px var(--hw-glow)); } body:has(svg [data-part~=&quot;hd-decoder&quot;]:hover) svg [data-part~=&quot;hd-decoder&quot;] { stroke: currentColor; stroke-width: 3.5px; filter: drop-shadow(0 0 5px var(--hw-glow)); } body:has(svg [data-part~=&quot;hd-decoder&quot;]:hover) .hw-term[data-part~=&quot;hd-decoder&quot;] { background-size: 100% 100%; } body:has(.hw-term[data-part~=&quot;hd-single&quot;]:is(:hover, :focus)) svg [data-part~=&quot;hd-single&quot;] { stroke: currentColor; stroke-width: 3.5px; filter: drop-shadow(0 0 5px var(--hw-glow)); } body:has(svg [data-part~=&quot;hd-single&quot;]:hover) svg [data-part~=&quot;hd-single&quot;] { stroke: currentColor; stroke-width: 3.5px; filter: drop-shadow(0 0 5px var(--hw-glow)); } body:has(svg [data-part~=&quot;hd-single&quot;]:hover) .hw-term[data-part~=&quot;hd-single&quot;] { background-size: 100% 100%; } body:has(.hw-term[data-part~=&quot;hd-pair&quot;]:is(:hover, :focus)) svg [data-part~=&quot;hd-pair&quot;] { stroke: currentColor; stroke-width: 3.5px; filter: drop-shadow(0 0 5px var(--hw-glow)); } body:has(svg [data-part~=&quot;hd-pair&quot;]:hover) svg [data-part~=&quot;hd-pair&quot;] { stroke: currentColor; stroke-width: 3.5px; filter: drop-shadow(0 0 5px var(--hw-glow)); } body:has(svg [data-part~=&quot;hd-pair&quot;]:hover) .hw-term[data-part~=&quot;hd-pair&quot;] { background-size: 100% 100%; } body:has(.hw-term[data-part~=&quot;hd-bias&quot;]:is(:hover, :focus)) svg [data-part~=&quot;hd-bias&quot;] { stroke: currentColor; stroke-width: 3.5px; filter: drop-shadow(0 0 5px var(--hw-glow)); } body:has(svg [data-part~=&quot;hd-bias&quot;]:hover) svg [data-part~=&quot;hd-bias&quot;] { stroke: currentColor; stroke-width: 3.5px; filter: drop-shadow(0 0 5px var(--hw-glow)); } body:has(svg [data-part~=&quot;hd-bias&quot;]:hover) .hw-term[data-part~=&quot;hd-bias&quot;] { background-size: 100% 100%; }</style><blockquote><div aria-hidden=\"true\">💡</div><div><p>TL;DR: At the time of writing, there is no official guide of running AlphaFold3 (AF3) on TPUs. Therefore, in this post, I’m going to share how I ran AF3 standard inference code on TPUs, compared to a 5090 and then optimized AF3 to run on v6e chips. At AF3′s standard inference settings <sup><a href=\"#fn-1\" id=\"fnref-1\">[Note 1]</a></sup> a folding job took <span data-part=\"v6e-stock\" tabindex=\"0\">5.81 s</span> <sup><a href=\"#fn-2\" id=\"fnref-2\">[Note 2]</a></sup>. Overlapping CPU featurization with the TPU and moving loop-invariant work out of the diffusion loop brought it to <span data-part=\"v6e-pipe\" tabindex=\"0\">3.56 s (1.6× faster)</span> with outputs identical to the original inference code <sup><a href=\"#fn-3\" id=\"fnref-3\">[Note 3]</a></sup>.</p><p>To take it further, to <span data-part=\"v6e-pad\" tabindex=\"0\">1.81 s (3.2× faster)</span>, two more changes were needed:</p><ul><li><span data-part=\"v6e-pallas\" tabindex=\"0\">three Pallas kernels</span>, for triangle attention, transitions and triangle multiplication;</li><li><span data-part=\"v6e-pad 5090-pad h100-pad\" tabindex=\"0\">tighter padding</span>.</li></ul><p>I will release the code for these experiments soon. If you have any questions, feel free to leave a comment. If you are interested in my notes about learning about TPU architectures and writing Pallas kernels, follow along <a href=\"https://ramith.fyi/notes/2026-10-29-diving-into-tpu-architectures/\">here</a>.</p><style>.tldr-chart { --plot: 8.5rem; --axis: 1.9em; display: flex; gap: 1.3em; margin: 1.4em 0 0.3em; padding-left: var(--axis); position: relative; background: linear-gradient(rgba(128, 128, 128, 0.6), rgba(128, 128, 128, 0.6)) right calc(var(--plot) - 1px) / calc(100% - var(--axis)) 1px no-repeat, repeating-linear-gradient(to top, rgba(128, 128, 128, 0.25) 0 1px, transparent 1px calc(var(--plot) * 2 / 7)) right top / calc(100% - var(--axis)) var(--plot) no-repeat; } .tldr-axis { position: absolute; left: 0; top: 0; width: calc(var(--axis) - 0.4em); height: var(--plot); font-size: 0.68rem; color: rgba(128, 128, 128, 0.95); } .tldr-axis span { position: absolute; right: 0; transform: translateY(50%); line-height: 1; } .tldr-group { min-width: 0; } .tldr-cols { display: grid; grid-template-rows: var(--plot) auto; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); column-gap: 4px; } .tldr-cell { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; min-height: 0; } .tldr-val { font-size: 0.8rem; font-weight: 600; line-height: 1; padding-bottom: 0.3em; white-space: nowrap; } .tldr-bar { width: min(100%, 1.2rem); } .tldr-label { padding-top: 0.45em; font-size: 0.72rem; line-height: 1.15; text-align: center; color: rgba(128, 128, 128, 0.95); } .tldr-label span { display: block; } .tldr-name { margin-top: 0.4em; padding-top: 0.25em; border-top: 1px solid rgba(128, 128, 128, 0.35); text-align: center; font-size: 0.9rem; } .tldr-key { margin-top: 0.5em; font-size: 0.9rem; color: rgba(128, 128, 128, 0.95); } @media (max-width: 760px) { .tldr-chart { --axis: 1.6em; gap: 0.6em; } .tldr-cols { column-gap: 2px; } .tldr-val { font-size: 0.68rem; } .tldr-label span { display: inline; } .tldr-label { writing-mode: vertical-rl; transform: rotate(180deg); justify-self: center; text-align: right; padding: 0.4em 0 0; font-size: 0.68rem; } }</style><div role=\"img\" aria-label=\"Seconds per fold. TPU v6e: stock 5.81, pipelining and hoisting 3.56, plus Pallas kernels 2.77, plus tighter padding 1.81. RTX 5090: stock with Triton 5.33, stock with XLA 6.10, pipelining and hoisting 4.32, plus tighter padding 3.11. H100: stock with Triton 5.57, pipelining and hoisting 3.37, plus tighter padding 2.43.\"><div><span>0</span><span>2</span><span>4</span><span>6 s</span></div><div><div><div><div>5.81</div><div data-part=\"v6e-stock\"></div></div><div><span>XLA</span> <span>(stock)</span></div><div><div>3.56</div><div data-part=\"v6e-pipe\"></div></div><div><span>pipelining</span> <span>+ hoisting</span></div><div><div>2.77</div><div data-part=\"v6e-pallas\"></div></div><div><span>+ Pallas</span> <span>kernels</span></div><div><div>1.81</div><div data-part=\"v6e-pad\"></div></div><div><span>+ tighter</span> <span>padding</span></div></div><div>TPU v6e</div></div><div><div><div><div>5.33</div><div data-part=\"5090-stock\"></div></div><div><span>Triton</span> <span>(stock)</span></div><div><div>6.10</div><div data-part=\"5090-xla\"></div></div><div><span>XLA</span> <span>(stock)</span></div><div><div>4.32</div><div data-part=\"5090-pipe\"></div></div><div><span>pipelining</span> <span>+ hoisting</span></div><div><div>3.11</div><div data-part=\"5090-pad\"></div></div><div><span>+ tighter</span> <span>padding</span></div></div><div>RTX 5090</div></div><div><div><div><div>5.57</div><div data-part=\"h100-stock\"></div></div><div><span>Triton</span> <span>(stock)</span></div><div><div>3.37</div><div data-part=\"h100-pipe\"></div></div><div><span>pipelining</span> <span>+ hoisting</span></div><div><div>2.43</div><div data-part=\"h100-pad\"></div></div><div><span>+ tighter</span> <span>padding</span></div></div><div>H100</div></div></div><div>Seconds per fold on one chip; the Pallas kernels are TPU-only.</div></div></blockquote><h2>Background</h2><p>Recently I’ve been training some protein design flow matching models on TPUs. To evaluate them protein folding models play an important role. So to keep things simpler (GCP buckets etc), I wanted to use AF3 on TPUs as well. However, the current AF3 codebase didn’t seem to support inference on TPUs.</p><style>.issue-quote { width: 55%; box-sizing: border-box; border: 1px solid rgba(128, 128, 128, 0.55); border-radius: 6px; padding: 0.4em 1.3em 0.8em; margin: 1.8em 0; } .issue-quote blockquote { margin: 0; padding: 0; } .issue-quote p { width: auto; margin: 0.5em 0 0; } @media (max-width: 760px) { .issue-quote { width: 100%; } }</style><div><blockquote>Correct, we don’t support TPU at the moment.</blockquote><p>— GitHub issue #550 <a href=\"#ref-af3-tpu-support\" role=\"doc-biblioref\">[1]</a>, October 2025</p></div><h2>Running AF3 with XLA</h2><p>Unsupported <em>doesn’t</em> mean we cannot run it on TPUs.</p><p>AF3 is written in JAX and it compiles through XLA, which runs natively on TPUs. So what’s the issue? For TPUs it does not have an optimized kernel for pair-biased attention.<sup><a href=\"#fn-4\" id=\"fnref-4\">[Note 4]</a></sup> Because of this, when you run AF3 on a v6e chip it runs slow even compared to a 5090 <sup><a href=\"#fn-5\" id=\"fnref-5\">[Note 5]</a></sup>.</p><p>To dig a little deeper: AF3 calls tokamax, an OpenXLA library of fused JAX kernels, and <code>--flash_attention_implementation</code> picks which tokamax backend runs.</p><p>However, on a TPU we hit two dead ends:</p><ol><li value=\"1\">tokamax’s fused GPU kernels (<code>triton</code>, the default, and <code>cudnn</code>) don’t run on TPUs.</li><li value=\"2\">tokamax’s TPU kernel (<code>mosaic</code>) doesn’t accept an attention bias at all <sup><a href=\"#fn-6\" id=\"fnref-6\">[Note 6]</a></sup>, and AF3′s triangle attention needs one: the pair bias.</li></ol><style>.af3-flow svg.typst-frame { width: 100% !important; height: auto !important; }</style><figure><sup><a href=\"#feed-note-7\">[Note 7]</a></sup><div><img src=\"https://ramith.fyi/feed-assets/b1a9cce4a0447fd6b93c8c06f0ddb2e60fccbd7c27f971525ac26e22389268e0.svg\" alt=\"Typeset mathematical expression\" width=\"433.74\" height=\"230.06\"></div></figure><p>If we don’t care about performance, we can just run the standard AF3 inference code with this flag <sup><a href=\"#fn-7\" id=\"fnref-7\">[Note 8]</a></sup>.</p><p><code>--flash_attention_implementation=xla</code></p><p>With it, AF3 computes attention with ordinary JAX operations instead of a hand-written GPU kernel. XLA compiles those for the TPU like the rest of AF3′s JAX code. But since this automatic compilation doesn’t result in a fused kernel, it writes the full attention-logit tensor to memory and reads it back <sup><a href=\"#fn-8\" id=\"fnref-8\">[Note 9]</a></sup>. How much does this hurt us?</p><style>figure.caption-below figcaption { float: none; clear: both; position: static; max-width: none; width: 100%; margin: 0.9rem 0 0; font-size: 1.1rem; line-height: 1.5; }</style><h2>Optimizations in a nutshell</h2><p>If we look at the timing for a full end to end run on a v6e chip, it runs in about 5.8 seconds. For context I measured this on a 5090 as well.</p><style>.fold-chart { --plot: 17rem; margin: 0.4em 0 0.2em; } .fold-legend { display: flex; flex-wrap: wrap; gap: 0.3em 1.3em; font-size: 1rem; margin: 0 0 1.4em; } .fold-key { display: inline-flex; align-items: center; gap: 0.45em; } .fold-swatch { display: inline-block; width: 1.1em; height: 0.85em; } .fold-hatch { background: repeating-linear-gradient(135deg, rgba(128, 128, 128, 0.55) 0 2px, rgba(128, 128, 128, 0.14) 2px 7px); } .fold-plot { display: flex; gap: 1.6em; padding-left: 2.2em; position: relative; background: linear-gradient(rgba(128, 128, 128, 0.6), rgba(128, 128, 128, 0.6)) right calc(var(--plot) - 1px) / calc(100% - 2.2em) 1px no-repeat, repeating-linear-gradient(to top, rgba(128, 128, 128, 0.22) 0 1px, transparent 1px calc(var(--plot) / 7)) right top / calc(100% - 2.2em) var(--plot) no-repeat; } .fold-axis { position: absolute; left: 0; top: 0; height: var(--plot); width: 1.8em; font-size: 0.8rem; color: rgba(128, 128, 128, 0.95); } .fold-axis span { position: absolute; right: 0; transform: translateY(50%); } .fold-group { min-width: 0; } .fold-cols { display: grid; grid-template-rows: var(--plot) auto; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); column-gap: 6px; } .fold-cell { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; min-height: 0; } .fold-val { font-size: 0.95rem; font-weight: 600; line-height: 1; padding-bottom: 0.3em; white-space: nowrap; } .fold-bar { display: flex; flex-direction: column; gap: 2px; width: min(100%, 3.4rem); } .fold-label span { display: block; } .fold-label { padding-top: 0.5em; font-size: 0.8rem; line-height: 1.2; text-align: center; overflow-wrap: anywhere; } .fold-name { margin-top: 0.5em; padding-top: 0.35em; border-top: 1px solid rgba(128, 128, 128, 0.45); text-align: center; font-size: 1.05rem; } @media (max-width: 760px) { .fold-chart { --plot: 14rem; } .fold-plot { gap: 0.7em; padding-left: 1.7em; background-size: calc(100% - 1.7em) 1px, calc(100% - 1.7em) var(--plot); } .fold-axis { width: 1.4em; } .fold-cols { column-gap: 3px; } .fold-val { font-size: 0.75rem; } .fold-label span { display: inline; } .fold-label { writing-mode: vertical-rl; transform: rotate(180deg); justify-self: center; text-align: right; padding: 0.5em 0 0; font-size: 0.75rem; } .fold-name { font-size: 0.95rem; } }</style><figure><div><div><span><span></span>featurization (host CPU)</span><span><span></span>stock AF3, XLA attention</span><span><span></span>stock AF3, fused Triton attention</span><span><span></span>pipelining + hoisting</span><span><span></span>+ Pallas kernels</span><span><span></span>+ tighter padding</span></div><div role=\"img\" aria-label=\"Seconds per fold. TPU v6e (host CPU AMD EPYC 9B14): stock 5.81 (1.85 featurization), pipelining and hoisting 3.56, plus Pallas kernels 2.77, plus tighter padding 1.81. RTX 5090 (host CPU Intel Core Ultra 9 285K): stock with Triton 5.33 (0.77 featurization), stock with XLA 6.10, pipelining and hoisting 4.32, plus tighter padding 3.11. H100: stock with Triton 5.57 (1.69 featurization), pipelining and hoisting 3.37, plus tighter padding 2.43.\"><div><span>0</span><span>1</span><span>2</span><span>3</span><span>4</span><span>5</span><span>6 s</span></div><div><div><div><div>5.81</div><div data-part=\"v6e-stock\"><div></div><div></div></div></div><div><span>XLA</span> <span>(stock)</span></div><div><div>3.56</div><div data-part=\"v6e-pipe\"><div></div></div></div><div><span>pipelining</span> <span>+ hoisting</span></div><div><div>2.77</div><div data-part=\"v6e-pallas\"><div></div></div></div><div><span>+ Pallas</span> <span>kernels</span></div><div><div>1.81</div><div data-part=\"v6e-pad\"><div></div></div></div><div><span>+ tighter</span> <span>padding</span></div></div><div>TPU v6e <span>(AMD EPYC 9B14)</span></div></div><div><div><div><div>5.33</div><div data-part=\"5090-stock\"><div></div><div></div></div></div><div><span>Triton</span> <span>(stock)</span></div><div><div>6.10</div><div data-part=\"5090-xla\"><div></div><div></div></div></div><div><span>XLA</span> <span>(stock)</span></div><div><div>4.32</div><div data-part=\"5090-pipe\"><div></div></div></div><div><span>pipelining</span> <span>+ hoisting</span></div><div><div>3.11</div><div data-part=\"5090-pad\"><div></div></div></div><div><span>+ tighter</span> <span>padding</span></div></div><div>RTX 5090 <span>(Intel Core Ultra 9 285K)</span></div></div><div><div><div><div>5.57</div><div data-part=\"h100-stock\"><div></div><div></div></div></div><div><span>Triton</span> <span>(stock)</span></div><div><div>3.37</div><div data-part=\"h100-pipe\"><div></div></div></div><div><span>pipelining</span> <span>+ hoisting</span></div><div><div>2.43</div><div data-part=\"h100-pad\"><div></div></div></div><div><span>+ tighter</span> <span>padding</span></div></div><div>H100</div></div></div></div><figcaption>Figure 2: End to end time for one fold of a 180-residue designed protein with two ligands at AF3′s standard settings (5 diffusion samples, 10 recycles, 200 denoising steps, no MSA): the median of 10 folds (2 designs × 5 seeds), compilation excluded. Stock AF3 featurizes on the host CPU (hatched) before each fold; the pipelined driver overlaps that with the accelerator, so it no longer adds to the time. The Pallas kernels are TPU-only; the GPUs get the same driver changes and tighter padding. With everything applied, the v6e (1.81 s) is 1.7× faster than the RTX 5090 (3.11 s) and 1.34× faster than the H100 (2.43 s).</figcaption></figure><h3>How much do precision errors propagate?</h3><p>Here are all the optimizations in one place, with what each one does to AF3′s predictions. Two of them just reorganize when and where the work happens, so the outputs stay the same as the original AF3 inference code’s.</p><p>The other four change the floating-point arithmetic. The kernels round the same way as AF3′s own code on more than 99% of values, but through 200 denoising steps even that <em>can</em> change the final structure slightly.</p><style>.change-table td:nth-child(3) { white-space: nowrap; } .shift-legend { display: flex; flex-wrap: wrap; gap: 0.3em 1.3em; font-size: 1rem; margin: 0 0 1em; }</style><figure><div><table><thead><tr><th>Change</th><th>What it does</th><th>Time per fold</th><th>Outputs vs stock AF3</th></tr></thead><tbody><tr><td><a href=\"#pipelining\">Pipelined driver</a></td><td>featurizes the next inputs on the CPU while the TPU runs the current one</td><td>5.81 → 3.80 s</td><td><strong>identical</strong>, bit for bit</td></tr><tr><td><a href=\"#hoisting\">Hoisting</a></td><td>computes the diffusion head’s position-independent work once per fold, not at each of the 200 steps</td><td>→ 3.56 s</td><td><strong>identical</strong>, bit for bit</td></tr><tr><td>Pallas triangle attention</td><td>fused attention that keeps the logits on-chip</td><td>→ 3.21 s</td><td>rounding: 99.996% of values identical</td></tr><tr><td>Pallas transition</td><td>LayerNorm, SwiGLU and output projection in one kernel</td><td>→ 3.08 s</td><td>rounding: 99.97% identical</td></tr><tr><td>Pallas triangle multiplication</td><td>fused triangle multiplication</td><td>→ 2.77 s</td><td>rounding: 99.2–99.6% identical</td></tr><tr><td>Tighter padding</td><td>pads to the next multiple of 16 tokens (192 here) instead of 256</td><td>→ 1.81 s</td><td>rounding, plus new starting noise for 4 of the 5 diffusion samples</td></tr></tbody></table></div><figcaption>Table 1: Every change in this post, in the order it is applied, with the warm time per fold after it (the bench and settings of the timing figure above). “Identical” means every raw output of the model, all 5 diffusion samples included, matches stock AF3 bit for bit on all 10 bench folds.</figcaption></figure><h2>Details about the kinds of optimizations I did</h2><h3 id=\"pipelining\">Pipelining: keeping the TPU busy</h3><p>Standard AF3 inference runs a fold <span data-part=\"pl-stock-feat pl-stock-tpu pl-stock-out\" tabindex=\"0\">one step at a time</span>. First the <span data-part=\"pl-stock-feat\" tabindex=\"0\">host CPU featurizes the input</span>. In summary, it</p><ul><li>parses it,</li><li>builds the token and atom features and</li><li>generates reference conformers for the ligands.</li></ul><p>On the TPU VM that takes 1.85 s, on a single core <sup><a href=\"#fn-9\" id=\"fnref-9\">[Note 10]</a></sup>. Then the <span data-part=\"pl-stock-tpu\" tabindex=\"0\">TPU runs the model</span>, and then the <span data-part=\"pl-stock-out\" tabindex=\"0\">CPU unpacks the results</span>. While one side works, the other waits.</p><p>The <span data-part=\"pl-pipe-feat pl-pipe-tpu pl-pipe-out\" tabindex=\"0\">pipelined driver</span> overlaps them. A <span data-part=\"pl-pipe-feat\" tabindex=\"0\">pool of CPU worker processes featurizes the next inputs</span> while <span data-part=\"pl-pipe-tpu\" tabindex=\"0\">the TPU is busy</span>, so the features are ready when it finishes. The model call is sent without waiting for the previous fold, and the <span data-part=\"pl-pipe-out\" tabindex=\"0\">main process unpacks and writes that fold’s results</span> while the TPU runs the next one. The weights also stay on the TPU, instead of being handed over again with every call.<strong>While this seems like a text book simple optimization, I was honestly suprised how helpful this becomes for heavy workloads</strong> <sup><a href=\"#fn-10\" id=\"fnref-10\">[Note 11]</a></sup>.</p><style>.pl-fig { --pl-mut: rgba(128, 128, 128, 0.95); } .pl-scroll { overflow-x: auto; } .pl-svg { display: block; width: 100%; min-width: 620px; height: auto; } .pl-svg text { fill: currentColor; font-size: 17px; } .pl-svg .pl-row { font-size: 17px; font-weight: 700; } .pl-svg .pl-kicker { font-size: 14.5px; letter-spacing: 1.3px; fill: var(--pl-mut); } .pl-svg .pl-sub, .pl-svg .pl-tick { font-size: 15px; fill: var(--pl-mut); } .pl-svg .pl-in { font-size: 14px; fill: #222; } .pl-svg .pl-in-feat { font-size: 14px; fill: currentColor; } .pl-svg .pl-feat { fill: url(#pl-hatch); stroke: rgba(128, 128, 128, 0.55); stroke-width: 1; } .pl-svg .pl-hatch-bg { fill: rgba(128, 128, 128, 0.14); } .pl-svg .pl-hatch-fg { fill: rgba(128, 128, 128, 0.55); } .pl-svg .pl-stock { fill: #afafaf; } .pl-svg .pl-pipe { fill: #9fd3aa; } .pl-svg .pl-out { fill: #555; } @media (prefers-color-scheme: dark) { .pl-svg .pl-out { fill: #c8c8c8; } } .pl-svg .pl-axis { stroke: var(--pl-mut); stroke-width: 1.2; fill: none; }</style><figure><div><img src=\"https://ramith.fyi/feed-assets/83d5707ed40dc8ca258c9b84d3f5b9d87a81ee6e74b8742bfd3bff4283202c89.svg\" alt=\"Typeset mathematical expression\"></div><figcaption>Figure 3: The pipelined driver (bottom) featurizes ahead on CPU worker processes and unpacks each fold while the TPU runs the next, so the TPU runs the folds back to back.</figcaption></figure><p>None of this changes the numerical results. The same functions run on the same inputs in the same order, so the outputs are bit for bit identical to the standard runner’s: all 10 folds on the v6e, and on an H100 every output array of the fold I compared. A fold drops from 5.81 to 3.80 s on the v6e <sup><a href=\"#fn-11\" id=\"fnref-11\">[Note 12]</a></sup>.</p><h3 id=\"hoisting\">Hoisting: what AF3 recomputes 1,000 times</h3><p>AF3 predicts a structure in two stages. The <span data-part=\"hd-trunk\" tabindex=\"0\">trunk</span> (48 Pairformer blocks, run 11 times with recycling) builds a single representation for each token and a pair representation for each pair of tokens, once per fold. The <span data-part=\"hd-loop\" tabindex=\"0\">diffusion module</span> then turns noise into atom coordinates over 200 denoising steps, for each of 5 samples: 1,000 calls per fold.</p><p>Each call does two kinds of work. Anything that touches the <strong>noisy coordinates</strong> or the <strong>noise level</strong> has to run again:</p><ul><li>the <span data-part=\"hd-encoder\" tabindex=\"0\">atom encoder</span>,</li><li>the <span data-part=\"hd-transformer\" tabindex=\"0\">transformer</span> and</li><li>the <span data-part=\"hd-decoder\" tabindex=\"0\">decoder</span>, and</li><li>the <span data-part=\"hd-single\" tabindex=\"0\">single conditioning</span> that carries the noise level into every layer.</li></ul><p>However, we are lucky that the <span data-part=\"hd-pair\" tabindex=\"0\">pair conditioning</span> is different. It is built only from the trunk’s pair representation and where the tokens sit in the sequence, <strong>so it never sees the noise level or the coordinates</strong>, and the diffusion transformer only reads it, to make the <span data-part=\"hd-bias\" tabindex=\"0\">attention bias</span> of each of its 24 layers. Those biases come out the same in all 1,000 calls.</p><style>.hd-fig { --hd-fix: #1d7a3a; --hd-step: #0068c3; --hd-mut: rgba(128, 128, 128, 0.95); } @media (prefers-color-scheme: dark) { .hd-fig { --hd-fix: #6fcf86; --hd-step: #5aa9f0; } } .hd-scroll { overflow-x: auto; } .hd-svg { display: block; width: 100%; min-width: 620px; height: auto; } .hd-svg text { fill: currentColor; font-size: 19px; } .hd-svg .hd-title { font-size: 20px; font-weight: 700; } .hd-svg .hd-sub { font-size: 16px; fill: var(--hd-mut); } .hd-svg .hd-kicker { font-size: 14.5px; letter-spacing: 1.3px; fill: var(--hd-mut); } .hd-svg .hd-sym { font-size: 23px; font-style: italic; } .hd-svg .hd-fix-t { fill: var(--hd-fix); } .hd-svg .hd-step-t { fill: var(--hd-step); } .hd-svg .hd-box { stroke-width: 1.6; } .hd-svg .hd-box.hd-fix { fill: var(--hd-fix); fill-opacity: 0.1; stroke: var(--hd-fix); } .hd-svg .hd-box.hd-step { fill: var(--hd-step); fill-opacity: 0.08; stroke: var(--hd-step); } .hd-svg .hd-box.hd-mut { fill: var(--hd-mut); fill-opacity: 0.08; stroke: var(--hd-mut); } .hd-svg .hd-loop { fill: none; stroke: var(--hd-mut); stroke-width: 1.6; } .hd-svg .hd-line { fill: none; stroke-width: 2; } .hd-svg .hd-line.hd-fix { stroke: var(--hd-fix); } .hd-svg .hd-line.hd-step { stroke: var(--hd-step); } .hd-svg .hd-line.hd-mut { stroke: var(--hd-mut); } .hd-svg .hd-head-fix, .hd-svg .hd-dot-fix { fill: var(--hd-fix); } .hd-svg .hd-head-step, .hd-svg .hd-dot-step { fill: var(--hd-step); } .hd-svg .hd-head-mut { fill: var(--hd-mut); }</style><figure><div><img src=\"https://ramith.fyi/feed-assets/1ba3e57161426cbdb24370533ad057453889885d26a72491bb3395924d6b61ef.svg\" alt=\"Typeset mathematical expression\"></div><figcaption>Figure 4: One fold of AF3′s diffusion. Green is computed from the trunk’s output alone and is the same in every denoising call; blue depends on the noisy atoms or the noise level and changes every call. Hoisting moves the green row out of the loop.</figcaption></figure><p>Standard AF3 inference still <span data-part=\"hd-pair hd-bias\" tabindex=\"0\">recomputes them every time</span>. XLA usually moves work like this out of a loop by itself, but here it refuses: one of the steps is a gather whose output is about 12 times larger than its input, and XLA does not hoist operations that grow their data. So I compute them once per fold and reuse them. On the v6e the outputs stay bit for bit identical <sup><a href=\"#fn-12\" id=\"fnref-12\">[Note 13]</a></sup> and a fold drops from 3.80 to 3.56 s<sup><a href=\"#fn-13\" id=\"fnref-13\">[Note 14]</a></sup></p><p>The same trick does not work in the trunk. There, triangle multiplication and triangle attention rewrite the pair representation in every block, so nothing derived from it stays fixed.</p><h3>Better kernels in Pallas</h3><p>I’m hoping to write a separate explainer on this soon. As it needs to go deep in <a href=\"https://ramith.fyi/notes/2026-10-29-diving-into-tpu-architectures/\">Pallas kernel writing.</a> Take a look at that note if you are interested in learning more!</p><h2>Do the predictions change?</h2><p>Pipelining and hoisting just organizes the computations, so that does not change results. However, the kernels can change outputs slightly through rounding <sup><a href=\"#fn-14\" id=\"fnref-14\">[Note 15]</a></sup>, so I checked them in two ways.</p><p>First, against real structures. I folded 40 proteins from the PDB from their deposited sequences (with their ligands, no MSA), once with original AF3 code and once with the kernels, with the same padding and seed, and scored each prediction against the deposited structure: lDDT over all the protein’s heavy atoms, where 1 is a perfect match.</p><p>If the kernels changed accuracy, the points below would move off the diagonal. For scale, the other two panels make changes that have nothing to do with the kernels: a new random seed <sup><a href=\"#fn-15\" id=\"fnref-15\">[Note 16]</a></sup>, and running original AF3 inference code on an RTX 5090 instead of the TPU.</p><style>.sc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.4em; margin: 0.4em 0 0.6em; } @media (max-width: 760px) { .sc-grid { grid-template-columns: minmax(0, 20rem); } } .sc-title { font-size: 1.05rem; line-height: 1.3; margin-bottom: 0.5em; } .sc-sub { font-size: 0.85em; color: rgba(128, 128, 128, 0.95); } .sc-frame { position: relative; padding: 0 0 2.6em 2.6em; } .sc-plot { position: relative; aspect-ratio: 1; border-left: 1px solid rgba(128, 128, 128, 0.6); border-bottom: 1px solid rgba(128, 128, 128, 0.6); background: linear-gradient(to bottom right, transparent calc(50% - 0.7px), rgba(128, 128, 128, 0.5) calc(50% - 0.7px), rgba(128, 128, 128, 0.5) calc(50% + 0.7px), transparent calc(50% + 0.7px)); } .sc-dot { position: absolute; width: 7px; height: 7px; border-radius: 50%; transform: translate(-50%, 50%); opacity: 0.9; box-shadow: 0 0 0 1px rgba(60, 60, 60, 0.45); } .sc-legend { display: flex; flex-wrap: wrap; gap: 0.3em 1.2em; font-size: 0.95rem; margin: 0 0 0.6em; } .sc-key { display: inline-flex; align-items: center; gap: 0.4em; } .sc-swatch { display: inline-block; width: 0.8em; height: 0.8em; border-radius: 50%; box-shadow: 0 0 0 1px rgba(60, 60, 60, 0.45); } .sc-xt, .sc-yt { position: absolute; font-size: 0.75rem; color: rgba(128, 128, 128, 0.95); } .sc-xt { top: 100%; transform: translate(-50%, 0.35em); } .sc-yt { right: 100%; transform: translate(-0.4em, 50%); } .sc-note { position: absolute; right: 4%; bottom: 5%; text-align: right; font-size: 0.85rem; line-height: 1.35; } .sc-xlabel { position: absolute; left: 2.6em; right: 0; bottom: 0.2em; text-align: center; font-size: 0.9rem; } .sc-ylabel { position: absolute; left: 0; top: 0; bottom: 2.6em; writing-mode: vertical-rl; transform: rotate(180deg); text-align: center; font-size: 0.9rem; }</style><figure><div><div>AF3′s confidence (mean pLDDT), left half before, right half after:<span><span></span>very high (≥ 90)</span><span><span></span>confident (70–90)</span><span><span></span>low (50–70)</span><span><span></span>very low (&lt; 50)</span></div><div><div><div>Pallas kernels<br><span>TPU v6e, same seed</span></div><div><div>with the kernels</div><div><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span>0.2</span><span>0.2</span><span>0.4</span><span>0.4</span><span>0.6</span><span>0.6</span><span>0.8</span><span>0.8</span><span>mean change −0.002<br>typical change 0.027</span></div><div>stock AF3</div></div></div><div><div>New random seed<br><span>stock AF3, RTX 5090</span></div><div><div>seed 231</div><div><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span>0.2</span><span>0.2</span><span>0.4</span><span>0.4</span><span>0.6</span><span>0.6</span><span>0.8</span><span>0.8</span><span>mean change +0.001<br>typical change 0.015</span></div><div>seed 230</div></div></div><div><div>Other hardware<br><span>stock AF3, same seed</span></div><div><div>TPU v6e</div><div><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span>0.2</span><span>0.2</span><span>0.4</span><span>0.4</span><span>0.6</span><span>0.6</span><span>0.8</span><span>0.8</span><span>mean change +0.008<br>typical change 0.025</span></div><div>RTX 5090</div></div></div></div></div><figcaption>Figure 5: Each dot is one PDB protein: how close AF3′s top structure is to the deposited one before (x) and after (y) a change, measured by all-atom lDDT (1 = perfect match). Dots on the diagonal did not change. Colours show AF3′s own confidence (mean pLDDT): left half before, right half after. “Mean change” is the average of after − before; “typical change” is the average size of the change. Single sequence (no MSA), AF3-LA weights, AF3′s standard settings.</figcaption></figure><p>On average kernels do not shift the predicted structures, but I did see 3 structures with larger lDDT deviations. We also see similar deviations when it comes to hardware changes anyway.</p><p>Measured as Cα RMSD to the deposited structure instead of lDDT, the picture is the same:</p><figure><div><div>AF3′s confidence (mean pLDDT), left half before, right half after:<span><span></span>very high (≥ 90)</span><span><span></span>confident (70–90)</span><span><span></span>low (50–70)</span><span><span></span>very low (&lt; 50)</span></div><div><div><div>Pallas kernels<br><span>TPU v6e, same seed</span></div><div><div>with the kernels (Å)</div><div><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span>0</span><span>0</span><span>10</span><span>10</span><span>20</span><span>20</span><span>30</span><span>30</span><span>mean change +0.07 Å<br>typical change 1.89 Å</span></div><div>stock AF3 (Å)</div></div></div><div><div>New random seed<br><span>stock AF3, RTX 5090</span></div><div><div>seed 231 (Å)</div><div><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span>0</span><span>0</span><span>10</span><span>10</span><span>20</span><span>20</span><span>30</span><span>30</span><span>mean change +0.30 Å<br>typical change 1.74 Å</span></div><div>seed 230 (Å)</div></div></div><div><div>Other hardware<br><span>stock AF3, same seed</span></div><div><div>TPU v6e (Å)</div><div><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span>0</span><span>0</span><span>10</span><span>10</span><span>20</span><span>20</span><span>30</span><span>30</span><span>mean change +0.45 Å<br>typical change 2.31 Å</span></div><div>RTX 5090 (Å)</div></div></div></div></div><figcaption>Figure 6: The same comparison in Cα RMSD to the deposited structure (Å; lower is better). Most of these predictions are far from the deposited structure (median about 17 Å), so this mostly tracks where the uncertain parts end up. On the residues AF3 is confident about (pLDDT above 70), the before and after structures differ by a median 0.73 Å with the kernels, 0.52 Å with a new seed and 0.70 Å on other hardware.</figcaption></figure><h3>Related implementations</h3><p>After I worked on this with claude + codex on optimizing AF3 for TPUs, I realized that I didn’t do much of a existing literature search. So we revisited Anthropic’s FlashPairformer code <a href=\"#ref-flashpairformer\" role=\"doc-biblioref\">[6]</a> that include three close comparisons, all targeting GPUs through Pallas’s Triton backend:</p><ul><li><a href=\"https://github.com/anthropics/uplifting-biomolecular-modeling/blob/f4f62fa6592ae4938d49b1757bea0cfeff9f468e/common/opt_core/opt_core/kernels/fpf_pallas/triattn_pallas.py\">Triangle attention</a>: tiled flash attention with the pair bias shared across triangle rows.</li><li><a href=\"https://github.com/anthropics/uplifting-biomolecular-modeling/blob/f4f62fa6592ae4938d49b1757bea0cfeff9f468e/common/opt_core/opt_core/kernels/fpf_pallas/transition_pallas.py\">Transition</a>: fused LayerNorm, SwiGLU and output projection.</li><li><a href=\"https://github.com/anthropics/uplifting-biomolecular-modeling/blob/f4f62fa6592ae4938d49b1757bea0cfeff9f468e/common/opt_core/opt_core/kernels/fpf_pallas/trimul_pallas.py\">Triangle multiplication</a>: fused input processing, a contraction, and fused output processing. Its source explicitly notes that fusion changes BF16 rounding and is not bitwise identical to stock execution.</li></ul><p>However, Anthropic’s repo mainly targets NVIDIA GPUs through the Pallas kernels. With only their compiler settings switched to TPU ones, the triangle-attention and triangle-multiplication kernels do not compile on a TPU: their memory layouts break the TPU’s block-shape rules.</p><p>Apart from Anthropic’s repo, JAX’s own Pallas FlashAttention for TPUs <a href=\"#ref-jax-tpu-flash-attention\" role=\"doc-biblioref\">[2]</a> does accept an additive attention bias, but only as a separate copy for every row.<sup><a href=\"#fn-16\" id=\"fnref-16\">[Note 17]</a></sup> But it was 1.6 – 4.4x slower than the kernel discussed in this post. Most of the gap is its handling of AF3′s 32-wide heads; building the per-row bias costs the rest.</p><p>Separately, JAXBench: Benchmarking Autonomous TPU Kernel Optimization <a href=\"#ref-jaxbench\" role=\"doc-biblioref\">[7]</a> includes an AlphaFold2-style triangle-multiplication workload in its TPU v6e benchmark; its reference workload <a href=\"#ref-jaxbench-trimul-reference\" role=\"doc-biblioref\">[8]</a> differs from the exact AF3 module.</p><p>In a future post, I’d like to dive into the details of the 3 kernels.</p><section role=\"doc-bibliography\"><h2>References</h2><ol><li id=\"ref-af3-tpu-support\" data-paper-title=\"AlphaFold 3 TPU support discussion: GitHub issue 550\">AlphaFold 3 contributors (2025). <a href=\"https://github.com/google-deepmind/alphafold3/issues/550#issuecomment-3472339330\">“AlphaFold 3 TPU support discussion: GitHub issue 550.”</a></li><li id=\"ref-jax-tpu-flash-attention\" data-paper-title=\"JAX Pallas TPU FlashAttention implementation\">The JAX Authors (n.d.). <a href=\"https://github.com/jax-ml/jax/blob/main/jax/experimental/pallas/ops/tpu/flash_attention.py\">“JAX Pallas TPU FlashAttention implementation.”</a></li><li id=\"ref-tokamax-tpu-bias\" data-paper-title=\"Tokamax: Pallas Mosaic TPU attention input-support checks\">OpenXLA contributors (n.d.). <a href=\"https://github.com/openxla/tokamax/blob/56be2dccc01641580524ba71470049597a1a85d5/tokamax/_src/ops/attention/pallas_mosaic_tpu_common.py#L44-L45\">“Tokamax: Pallas Mosaic TPU attention input-support checks.”</a></li><li id=\"ref-af3-attention-flag\" data-paper-title=\"AlphaFold 3 inference runner: flash-attention implementation flag\">Google DeepMind (n.d.). <a href=\"https://github.com/google-deepmind/alphafold3/blob/5e23d45bff3a4c1993516ead2ec848cb42d64c1a/run_alphafold.py#L368-L380\">“AlphaFold 3 inference runner: flash-attention implementation flag.”</a></li><li id=\"ref-flashattention\" data-paper-title=\"FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness\">Dao et al. (2022). <a href=\"https://arxiv.org/abs/2205.14135\">“FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness.”</a></li><li id=\"ref-flashpairformer\" data-paper-title=\"FlashPairformer: Pallas kernels for biomolecular modeling on GPUs\">Anthropic (n.d.). <a href=\"https://github.com/anthropics/uplifting-biomolecular-modeling/tree/f4f62fa6592ae4938d49b1757bea0cfeff9f468e/common/opt_core/opt_core/kernels/fpf_pallas\">“FlashPairformer: Pallas kernels for biomolecular modeling on GPUs.”</a></li><li id=\"ref-jaxbench\" data-paper-title=\"JAXBench: Benchmarking Autonomous TPU Kernel Optimization\">Tschand et al. (2026). <a href=\"https://arxiv.org/abs/2607.20466\">“JAXBench: Benchmarking Autonomous TPU Kernel Optimization.”</a></li><li id=\"ref-jaxbench-trimul-reference\" data-paper-title=\"JAXBench: AlphaFold2-style triangle-multiplication reference workload\">JAXBench contributors (n.d.). <a href=\"https://github.com/AI-Hypercomputer/accelerator-agents/blob/7597b737f2486166834d59162bff1f4da13634fb/JAXBench/benchmark/level1/17p_Triangle_Multiplication/baseline.py\">“JAXBench: AlphaFold2-style triangle-multiplication reference workload.”</a></li></ol></section><footer>Unless otherwise noted, the original text of this post is licensed under the <a href=\"https://creativecommons.org/licenses/by/4.0/\">Creative Commons Attribution 4.0 International License</a>. Separately credited material may have different rights. <a href=\"https://ramith.fyi/license/\">Licensing details</a>.</footer><h2>Notes</h2><ol><li id=\"fn-1\"><sup><a href=\"#fnref-1\">1</a></sup> A 180-residue designed protein with two ligands, zinc and orotate (192 tokens, about 1,400 atoms), predicted from its sequence alone (no MSA or templates) with 5 diffusion samples, 10 recycles and 200 denoising steps. Times are per fold on one chip, the median over 10 folds (2 designs × 5 seeds).</li><li id=\"fn-2\"><sup><a href=\"#fnref-2\">2</a></sup> For context, an RTX 5090 runs AF3 at <span data-part=\"5090-stock\" tabindex=\"0\">5.33 s</span> per fold, so before the optimizations the TPU was slower than a 5090, which was sad to see to begin with.</li><li id=\"fn-3\"><sup><a href=\"#fnref-3\">3</a></sup> this improvement is <span data-part=\"5090-pipe h100-pipe\" tabindex=\"0\">applicable even for NVIDIA GPUs</span> as well</li><li id=\"fn-4\"><sup><a href=\"#fnref-4\">4</a></sup> AF3 actually has four pair-biased attentions: triangle attn., the single attn in the <a href=\"https://gasredx09.github.io/af3-slides/talks/af3/index.html#/31\">pairformer</a>, the diffusion transformer and the atom transformers. <strong>Only triangle attention goes through tokamax (since its the most heaviest).</strong></li><li id=\"fn-5\"><sup><a href=\"#fnref-5\">5</a></sup> Actually on both GCP and Modal, the CPU perf was slower compared to my 5090</li><li id=\"fn-6\"><sup><a href=\"#fnref-6\">6</a></sup> The check is in <code>pallas_mosaic_tpu_common.py</code> <a href=\"#ref-tokamax-tpu-bias\" role=\"doc-biblioref\">[3]</a> (as of tokamax 0.0.17)</li><li id=\"feed-note-7\">Figure 1: Why AF3 has no fast attention path on a TPU. AF3 hands its pair-biased triangle attention to tokamax. tokamax’s fused GPU kernels don’t run on TPUs, and its TPU kernel doesn’t accept a bias, which leaves the plain-XLA path: it runs anywhere, but unfused.</li><li id=\"fn-7\"><sup><a href=\"#fnref-7\">7</a></sup> Defined in <code>run_alphafold.py</code> <a href=\"#ref-af3-attention-flag\" role=\"doc-biblioref\">[4]</a></li><li id=\"fn-8\"><sup><a href=\"#fnref-8\">8</a></sup> Flash attention (Dao et al., 2022 <a href=\"#ref-flashattention\" role=\"doc-biblioref\">[5]</a>) computes softmax(QKᵀ + bias)·V in tiles held in fast on-chip memory, keeping a running maximum and sum for the softmax, so the N × N matrix of logits is never written to the slower main memory (HBM). That removes the largest memory traffic in attention. The TPU kernel later in this post uses the same idea in a simpler form: at these sizes a whole row of logits fits on-chip, so it never has to tile across keys.</li><li id=\"fn-9\"><sup><a href=\"#fnref-9\">9</a></sup> on the modal instance (h100) this cpu time was 1.69 s. Interestingly my 5090 CPU was way faster (0.77 s)</li><li id=\"fn-10\"><sup><a href=\"#fnref-10\">10</a></sup> say you fold 1000s of structures</li><li id=\"fn-11\"><sup><a href=\"#fnref-11\">11</a></sup> How much it helps depends on the host CPU, because featurization runs on one core. The TPU VM’s AMD EPYC 9B14 is about 2.4× slower per core than the RTX 5090 workstation’s Core Ultra 9 285K, so hiding featurization pays off most on the TPU: 1.53× on the v6e and 1.61× on the H100 (5.57 → 3.45 s), against 1.24× on the 5090.</li><li id=\"fn-12\"><sup><a href=\"#fnref-12\">12</a></sup> On GPUs, XLA compiles the reorganized computation slightly differently, so the outputs agree only up to rounding.</li><li id=\"fn-13\"><sup><a href=\"#fnref-13\">13</a></sup> This hoisting comes at a cost: memory. The bias maps (24 layers × 16 heads, one <span role=\"math\"><img src=\"https://ramith.fyi/feed-assets/6bb55241e814d40993412e09afcad3e453d3c2156fac58bc9ec175831114d207.svg\" alt=\"Typeset mathematical expression\" width=\"44.59\" height=\"10.02\"></span> map each) now stay in memory for the whole run instead of one block at a time, about 1.5 KB per token pair. That is under 0.1 GB for the 192-token designs here, but about 1.6 GB at 1,024 tokens.</li><li id=\"fn-14\"><sup><a href=\"#fnref-14\">14</a></sup> especially when propagating through 48 pairformer blocks</li><li id=\"fn-15\"><sup><a href=\"#fnref-15\">15</a></sup> Here the seed means the diffusion model’s seed. Rest of the Pairformer outputs stay the same.</li><li id=\"fn-16\"><sup><a href=\"#fnref-16\">16</a></sup> Triangle attention runs one attention per row of the pair grid, and every row adds the same bias: one N × N matrix per head, computed from the pair representation. JAX’s kernel takes the bias as an input shaped [batch, heads, queries, keys], so with the rows as the batch, that shared bias has to be repeated once per row. At 256 tokens with AF3′s 4 heads, that is about 67 million bias values instead of 262 thousand, written to memory before the kernel runs and read back inside it. The kernel in this post reads the one shared bias directly.</li></ol>",
      "date_published": "2026-10-24T00:00:00Z",
      "authors": [
        {
          "name": "Ramith Hettiarachchi",
          "url": "https://ramith.fyi"
        }
      ],
      "language": "en",
      "tags": [
        "scholarly"
      ]
    },
    {
      "id": "https://ramith.fyi/posts/2026-10-04-clustering-pockets-by-their-interactions-plinder-pli-unique-qcov/",
      "url": "https://ramith.fyi/posts/2026-10-04-clustering-pockets-by-their-interactions-plinder-pli-unique-qcov/",
      "title": "Clustering pockets by their interactions, and a gotcha in PLINDER 2024-06/v2 pli_unique_qcov",
      "content_html": "<h2>Clustering pockets by their interactions, and a gotcha in PLINDER 2024-06/v2 pli_unique_qcov</h2><div data-title=\"Clustering pockets by their interactions, and a gotcha in PLINDER 2024-06/v2 pli_unique_qcov\" data-slug=\"2026-10-04-clustering-pockets-by-their-interactions-plinder-pli-unique-qcov\" data-authors=\"Ramith Hettiarachchi\" data-date-published=\"2026-10-04\" data-language=\"en\" data-status=\"published\" data-license=\"CC-BY-4.0\" data-collections=\"scholarly; protein-ligand interactions; clustering\" data-doi=\"\"><p>By Ramith Hettiarachchi ⋅ Published <time datetime=\"2026-10-04\">2026-10-04</time></p></div><blockquote><div aria-hidden=\"true\">💡</div><div>TL;DR: Pocket clustering is a tricky problem, and if you are using <code>pli_unique_qcov__50__community</code> clusters from PLINDER 2024-06/v2 (shipped as the split’s <code>cluster</code> column) for balanced or clustered training, this post is worth a read: a bug in the score behind those clusters changes which pockets end up together.</div></blockquote><p>Lately I’ve been training generative models for proteins. While diving into this area, I went down a rabbit hole on how to cluster pockets by similarity. This matters both for building train/test splits without leakage and sampling training data in a balanced way.</p><p>While clustering based on protein sequence similarity or ligand similarity alone seems like a decent way to start with, my main concern was that this might not capture the actual pocket interactions that we are interested in. This means that there could be potentially two ligands that are somewhat different in similarity, yet they interact with the protein in the same way. The other way, of course could be true as well. Same ligand interacting with a several different proteins, yet forming similar interactions. <sup><a href=\"#fn-1\" id=\"fnref-1\">[Note 1]</a></sup> Ideally, a model trained on these complexes should see the full range of interaction types, rather than leaving some interaction modes behind.</p><p>When I started pondering about this question, I thought to look at the PLINDER dataset <a href=\"#ref-plinder\" role=\"doc-biblioref\">[1]</a>. They have done an amazing job in processing the PDB and annotating protein-ligand interactions. So my initial motivation was to use their own clustering for my training sampling.<sup><a href=\"#fn-2\" id=\"fnref-2\">[Note 2]</a></sup> Let me lay out the key idea in clustering pockets, by leaving some detailed information later in the post.</p><h3>How PLINDER compares two pockets (<code>pli_unique_qcov</code>)</h3><p>First, for a protein complex A and B, we need to figure out which residue in A corresponds to residue in complex B. Plinder does this through MMseqs <a href=\"#ref-mmseqs2\" role=\"doc-biblioref\">[2]</a>, and Foldseek <a href=\"#ref-foldseek\" role=\"doc-biblioref\">[3]</a>. Foldseek matters beause even if the sequences have diverged, they can share a fold <sup><a href=\"#fn-3\" id=\"fnref-3\">[Note 3]</a></sup>. PLINDER computes each similarity score from both alignments and keeps the higher one. Put simply, the key idea in PLINDER is to figure out :</p><ol><li value=\"1\">Align residues of protein A and B</li><li value=\"2\">keep only the aligned pairs where both residues are in their binding pocket (within 6 Å of the ligand, or interacting with it),</li><li value=\"3\">compare the interaction fingerprints of each such pair, add up the matches, and divide by the size of A’s fingerprint, and</li><li value=\"4\">connect A and B in a graph when that score passes a threshold, then take clusters of the graph.</li></ol><p>After step 1, say we have an ARG176 and a ARG98, and assume that they are aligned. Now, say both of them have a fingerprint like <sup><a href=\"#fn-4\" id=\"fnref-4\">[Note 4]</a></sup>:</p><pre><code data-lang=\"python\">ARG176 <span>=</span> <span>Counter</span>({<span>&quot;</span><span>hydrogen_bond</span><span>&quot;</span>: <span>2</span>, <span>&quot;</span><span>hydrophobic</span><span>&quot;</span>: <span>1</span>})\nARG98  <span>=</span> <span>Counter</span>({<span>&quot;</span><span>hydrogen_bond</span><span>&quot;</span>: <span>1</span>, <span>&quot;</span><span>hydrophobic</span><span>&quot;</span>: <span>1</span>})</code></pre><p>Now in a way, if we disregard the fact that counts are different, both these residues have the same two kinds of interactions, a hydrogen bond and a hydrophobic contact. So these two residues should count as a full match. Note that we have to do this for each pair. That is the idea behind PLINDER’s <code>pli_unique_qcov</code>. <sup><a href=\"#fn-5\" id=\"fnref-5\">[Note 5]</a></sup></p><p>Let’s get back to <code>pli_unique_qcov </code>, which is used for several the downstream graph making (<code>pli_unique_qcov__50__community</code>) in PLINDER 2024-06/v2. To define <code>pli_unique_qcov<span>&#x20;</span></code> more precisely, let <span role=\"math\"><img src=\"https://ramith.fyi/feed-assets/33d082735bb4d0ae7f2256cd1ad41d1051a9b9c7c6f38998acca9bf07792b894.svg\" alt=\"Typeset mathematical expression\" width=\"11.47\" height=\"10.02\"></span> be the aligned pairs <span role=\"math\"><img src=\"https://ramith.fyi/feed-assets/3cf48f10e435b1e270c10f123998da7ffc7016c60b893bf3ac29a08b6f3f6434.svg\" alt=\"Typeset mathematical expression\" width=\"32.19\" height=\"10.02\"></span> where both residues are in their pockets, and let <span role=\"math\"><img src=\"https://ramith.fyi/feed-assets/42ad7c27aff02b95003020037fa0fdb479b59029ebd55d552cb0ff3427ca80ed.svg\" alt=\"Typeset mathematical expression\" width=\"28.95\" height=\"10.02\"></span> be the set of interaction types at residue <span role=\"math\"><img src=\"https://ramith.fyi/feed-assets/b37b3012ca0f224bc3828e81a582d6ff84e3ba697c5feef68fafdb89c4fb6d1b.svg\" alt=\"Typeset mathematical expression\" width=\"6.81\" height=\"10.02\"></span> (the keys of its <code>Counter</code>). Then <sup><a href=\"#fn-6\" id=\"fnref-6\">[Note 6]</a></sup></p><figure role=\"math\"><img src=\"https://ramith.fyi/feed-assets/fba112fc883fd406fa1aa819f39c0b80051a2de6d42265894d6fae28379c1eeb.svg\" alt=\"Typeset mathematical expression\" width=\"286.24\" height=\"43.03\"></figure><p>where the bottom sum runs over A’s interacting residues. Note that the score is divided by A’s total, so <span role=\"math\"><img src=\"https://ramith.fyi/feed-assets/71d7ee7ff3554092ba14c31bf90a234128b3283b83f8f7d4087ecd4a02431e6e.svg\" alt=\"Typeset mathematical expression\" width=\"63.6\" height=\"10.02\"></span> and <span role=\"math\"><img src=\"https://ramith.fyi/feed-assets/340acd21d998367faca28a51398777448ea3b87062c21746652d325081a4e3a0.svg\" alt=\"Typeset mathematical expression\" width=\"63.6\" height=\"10.02\"></span> can differ.</p><h3>So what’s the gotcha ?</h3><p>As I mentioned before, the reason I turned to PLINDER was to reuse their clustering for my training. However, in the process of visualizing the clusters, and understanding the, <code>pli_unique_qcov<span>&#x20;</span></code> metric, codex noticed a bug in <a href=\"https://github.com/plinder-org/plinder/blob/acd6c54079f7c29d4f9cfe13fb69fc247cb10395/src/plinder/data/utils/annotations/get_similarity_scores.py#L796-L801\">lines 796–801 of <code>get_similarity_scores.py</code></a>. . Even though <code>pli_unique_qcov<span>&#x20;</span></code> is supposed to look at the interaction <em>type</em> of a paired residue, it was comparing the interaction <em>counts</em>.</p><pre><code data-lang=\"python\"><span>len</span>(<span>set</span>(q_interactions[q_n].<span>values</span>()) <span>&amp;</span> <span>set</span>(t_interactions[t_n].<span>values</span>()))</code></pre><p>Because of this, going back to our previous example,</p><pre><code data-lang=\"python\">ARG176 <span>=</span> <span>Counter</span>({<span>&quot;</span><span>hydrogen_bond</span><span>&quot;</span>: <span>2</span>, <span>&quot;</span><span>hydrophobic</span><span>&quot;</span>: <span>1</span>})\nARG98  <span>=</span> <span>Counter</span>({<span>&quot;</span><span>hydrogen_bond</span><span>&quot;</span>: <span>1</span>, <span>&quot;</span><span>hydrophobic</span><span>&quot;</span>: <span>1</span>})</code></pre><p>Suppose these are the only interacting residues in their pockets, so the whole score comes from this one pair. For ARG176 the code sees the counts {2, 1}, and for ARG98 it sees {1}. They share one count, so the pair scores 0.5 instead of 1.0. Even ARG98 compared with itself scores only 0.5. A more prominent mistake would be: a residue with one hydrophobic contact and a residue with one salt bridge both have the count 1, so they score as a full match despite sharing no interaction at all. Even though this seems like a big issue, I think partly its watered down <sup><a href=\"#fn-7\" id=\"fnref-7\">[Note 7]</a></sup> since we align the two proteins first. However, for my train set I did see clusters drastically change (more similar pockets grouped vice-versa). So the aligned residues anyway are somewhat similar interaction forming residues. But it does compare the incorrect thing. For instance:</p><figure><p><sup><a href=\"#feed-note-8\">[Note 8]</a></sup></p><table><thead><tr><th>Example</th><th>Should score</th><th>v2 code scores</th></tr></thead><tbody><tr><td><code>{&quot;hydrophobic&quot;: 1}</code> vs <code>{&quot;salt_bridge&quot;: 1}</code></td><td>0</td><td><strong>1.0</strong></td></tr><tr><td>ARG98 vs itself</td><td>1.0</td><td><strong>0.5</strong></td></tr><tr><td>ARG176 → ARG98</td><td>1.0</td><td><strong>0.5</strong></td></tr></tbody></table></figure><h4 id=\"arg224-example\">A PDB example: <code>7FK1 (W3H)</code>, <code>7FLE (VB9)</code>, <code>7FL1 (VO9)</code></h4><p>The three PLINDER systems below are crystal structures of Aar2/RNaseH from a fragment screen <a href=\"#ref-f2x\" role=\"doc-biblioref\">[4]</a>, and in each one PLINDER annotates one interacting residue, <code>Arg224</code>:</p><ul><li><code>7fk1__1__1.A__1.C</code></li><li><code>7fle__1__1.A__1.C</code></li><li><code>7fl1__1__1.A__1.D</code></li></ul><p>These are PLINDER’s annotations for Arg224 in each:</p><pre><code data-lang=\"python\">arg224_7FK1 <span>=</span> <span>Counter</span>({<span>&quot;</span><span>type:salt_bridges__protispos:True</span><span>&quot;</span>: <span>1</span>})\narg224_7FLE <span>=</span> <span>Counter</span>({<span>&quot;</span><span>type:hydrogen_bonds__protisdon:True__sidechain:True</span><span>&quot;</span>: <span>1</span>})\narg224_7FL1 <span>=</span> <span>Counter</span>({<span>&quot;</span><span>type:hydrogen_bonds__protisdon:True__sidechain:True</span><span>&quot;</span>: <span>2</span>})</code></pre><p>Because each pocket has only this one interacting residue, the score between two of these systems is just this residue pair, this makes it easier to show the result of the equation:</p><figure><p><sup><a href=\"#feed-note-9\">[Note 9]</a></sup></p><table><thead><tr><th>Pair</th><th>Arg224 interactions</th><th>Intended <code>pli_unique_qcov</code></th><th>Released <code>pli_unique_qcov</code></th></tr></thead><tbody><tr><td>7FK1 vs 7FLE</td><td>1 salt bridge vs 1 H-bond</td><td>0</td><td><strong>1.0</strong></td></tr><tr><td>7FLE vs 7FL1</td><td>1 H-bond vs 2 H-bonds</td><td>1.0</td><td><strong>0</strong></td></tr><tr><td>7FK1 vs 7FL1</td><td>1 salt bridge vs 2 H-bond</td><td>0</td><td>0</td></tr></tbody></table></figure><p>So I fixed this locally, which took some groundwork. The released data don’t include residue-level alignments, so this meant re-running MMseqs2 and Foldseek on the system pairs PLINDER had already matched. Afterwards the clusters looked bit better. In a later post I’d like to share that!</p><h3>Summary</h3><p>I think PLINDER authors might be actively working on new releases, and better clustering approaches. This article hopes to just document a potential bug in PLINDER I got stuck in and document it for anyone who else might be going to train with clustered pli systems. On the other hand, this shows the human-AI collaboration aspect 😅, if I hadn’t tried to understand how clustering was done with codex, or if I tried to do this alone, or had used <code>pli_unique_qcov__50__community</code> directly, I wouldn’t have noticed this myself.</p><p>I’m really grateful for the PLINDER paper for their work, diving into these metrics made me realize how complicated it is to define metrics, and cluster things. Even if you have the right metric, you have think through lots of different views on what it means to be included in a cluster. I’ve been postponing of writing this for around 2 months, I’m glad I documented this finally and I’d like to learn from you as well!</p><section role=\"doc-bibliography\"><h2>References</h2><ol><li id=\"ref-plinder\" data-paper-title=\"PLINDER: The protein-ligand interactions dataset and evaluation resource\">Durairaj et al. (2024). <a href=\"https://doi.org/10.1101/2024.07.17.603955\">“PLINDER: The protein-ligand interactions dataset and evaluation resource.”</a></li><li id=\"ref-mmseqs2\" data-paper-title=\"MMseqs2 enables sensitive protein sequence searching for the analysis of massive data sets\">Steinegger and Söding (2017). <a href=\"https://doi.org/10.1038/nbt.3988\">“MMseqs2 enables sensitive protein sequence searching for the analysis of massive data sets.”</a></li><li id=\"ref-foldseek\" data-paper-title=\"Fast and accurate protein structure search with Foldseek\">van Kempen et al. (2024). <a href=\"https://doi.org/10.1038/s41587-023-01773-0\">“Fast and accurate protein structure search with Foldseek.”</a></li><li id=\"ref-f2x\" data-paper-title=\"Large-Scale Crystallographic Fragment Screening Expedites Compound Optimization and Identifies Putative Protein-Protein Interaction Sites\">Barthel et al. (2022). <a href=\"https://doi.org/10.1021/acs.jmedchem.2c01165\">“Large-Scale Crystallographic Fragment Screening Expedites Compound Optimization and Identifies Putative Protein-Protein Interaction Sites.”</a></li></ol></section><footer>Unless otherwise noted, the original text of this post is licensed under the <a href=\"https://creativecommons.org/licenses/by/4.0/\">Creative Commons Attribution 4.0 International License</a>. Separately credited material may have different rights. <a href=\"https://ramith.fyi/license/\">Licensing details</a>.</footer><h2>Notes</h2><ol><li id=\"fn-1\"><sup><a href=\"#fnref-1\">1</a></sup> Just a heads up: if we compare interactions only at residue pairs that a whole-chain MMseqs2/Foldseek alignment lines up, two unrelated proteins that hold a ligand the same way <em>may</em> never get compared, since the protein is so different. That’s not the focus of this post.</li><li id=\"fn-2\"><sup><a href=\"#fnref-2\">2</a></sup> Because they release <code>pli_unique_qcov__50__community</code>.</li><li id=\"fn-3\"><sup><a href=\"#fnref-3\">3</a></sup> I wonder if the counter example i stated in the above footnote would be considered</li><li id=\"fn-4\"><sup><a href=\"#fnref-4\">4</a></sup> This is a simplified example. For a real one from the PLINDER release, see <a href=\"#arg224-example\">the Arg224 example below</a>.</li><li id=\"fn-5\"><sup><a href=\"#fnref-5\">5</a></sup> Note that its sibling score, <code>pli_qcov</code> is different, it counts every interaction, repeats included, and asks what fraction of A’s interactions B reproduces.</li><li id=\"fn-6\"><sup><a href=\"#fnref-6\">6</a></sup> For simplicity, this formula assumes a single ligand and no artifact ligands. PLINDER counts unique fingerprints separately per ligand in the denominator, but merges them across non-artifact ligands at each residue in the numerator. Even after fixing the bug, a multi-ligand system can therefore score below 100% against itself.</li><li id=\"fn-7\"><sup><a href=\"#fnref-7\">7</a></sup> When building the 2024-06/v2 test set, PLINDER removes any train system that is a direct neighbour of a test system in either of two graphs: pli_unique_qcov ≥ 30, protein_seqsim_weighted_sum ≥ 30 (protein sequence similarity). However, v2 test set is initially sampled from communities/clusters built using pli_unique_qcov at a threshold of 50.</li><li id=\"feed-note-8\">Table 1: <code>pli_unique_qcov</code> when each pocket has a single interacting residue: intended vs. PLINDER 2024-06/v2.</li><li id=\"feed-note-9\">Table 2: Arg224 of Aar2/RNaseH in three ligand-bound structures (PLINDER 2024-06/v2). Scores are the same in either direction for these pairs; released percentages are shown as fractions. Bold marks where the released score is wrong.</li></ol>",
      "date_published": "2026-10-04T00:00:00Z",
      "authors": [
        {
          "name": "Ramith Hettiarachchi",
          "url": "https://ramith.fyi"
        }
      ],
      "language": "en",
      "tags": [
        "scholarly",
        "protein-ligand interactions",
        "clustering"
      ]
    },
    {
      "id": "https://ramith.fyi/posts/2024-02-12-an-open-science-journey/",
      "url": "https://ramith.fyi/posts/2024-02-12-an-open-science-journey/",
      "title": "An inspiring open science journey to remember 💙",
      "content_html": "<h2>An inspiring open science journey to remember 💙</h2><div data-title=\"An inspiring open science journey to remember 💙\" data-slug=\"2024-02-12-an-open-science-journey\" data-authors=\"Ramith Hettiarachchi\" data-date-published=\"2024-02-12\" data-language=\"en\" data-status=\"published\" data-license=\"CC-BY-4.0\" data-collections=\"scholarly\" data-doi=\"\"><p>By Ramith Hettiarachchi ⋅ Published <time datetime=\"2024-02-12\">2024-02-12</time></p></div><p><em><strong>Aya (Model &amp; Dataset) is going to be released in 6 hours from now. Meanwhile, I thought of writing my thoughts on my journey and the things I have learned while collaborating with so many people across the world who had a common set of values and goals. I’ve been part of this effort since June 2023, and time flew so fast that I forgot how I even joined this in the first place. So this is a reflection for me to look back again at this day, from sometime in the future.</strong></em></p><p>—</p><p><em>We all know that data is a cornerstone of AI advancements. But apart from English, most languages in the world have negligible representation on the Internet. <strong>Can we change this with the power of community collaboration? This was what <a href=\"https://cohere.com/research/aya\">Aya</a> was all about.</strong></em> It <em>was a massive global effort to uplift many under-resourced languages in the context of the current natural language advancement landscape.</em></p><p>Before elaborating on how I joined this project and the specifics of it, <strong>I want to think out loud about open science efforts.</strong> During the duration of this project, I saw,</p><ul><li>people from various age groups, various levels of expertise gather towards building datasets for under resourced languages</li><li>like minded individuals coming together for a common goal and inspiring more people to work on these research questions</li><li>people who are new to research leading this effort, carefully paying attention to very subtle details and writing a research paper encapsulating the effort in terms of a scientific article <a href=\"#ref-model\" role=\"doc-biblioref\">[1]</a> <a href=\"#ref-dataset\" role=\"doc-biblioref\">[2]</a>.</li></ul><p><strong>All this unfolding on Discord was so inspiring to watch.</strong> And to finally see a multilingual large language model (LLM), proficient in 101 languages – and more importantly, seeing Aya-101 <a href=\"#ref-model\" role=\"doc-biblioref\">[1]</a> proficient in my native language, Sinhala (සිංහල) too was such a joy 🎉❤️.</p><p>—</p><p><em>I asked these two questions from Aya in Sinhala: 1)</em> වෙහෙසකර අභියෝගයක් සාර්ථකව ජය ගත් පසු කුමක්ද කරන්න ඕනේ? 2) ලංකාවෙ නිදහස් දිනය කවද්ද?<br>While there is a long way to go for Sinhala LLMs I’m honestly suprised that it follows Sinhala instructions quite nicely!</p><figure><div><div><a href=\"https://ramith.fyi/assets/posts/2024-02-12-an-open-science-journey/Screenshot-2024-03-31-at-23.54.26.png\" aria-label=\"Open full-size image: Aya-101 responding to a Sinhala prompt\"><img src=\"https://ramith.fyi/assets/posts/2024-02-12-an-open-science-journey/Screenshot-2024-03-31-at-23.54.26.png\" alt=\"Aya-101 responding to a Sinhala prompt\" loading=\"lazy\"></a></div><div><a href=\"https://ramith.fyi/assets/posts/2024-02-12-an-open-science-journey/Screenshot-2024-03-31-at-23.53.47.png\" aria-label=\"Open full-size image: Another Sinhala conversation with Aya-101\"><img src=\"https://ramith.fyi/assets/posts/2024-02-12-an-open-science-journey/Screenshot-2024-03-31-at-23.53.47.png\" alt=\"Another Sinhala conversation with Aya-101\" loading=\"lazy\"></a></div><div><a href=\"https://ramith.fyi/assets/posts/2024-02-12-an-open-science-journey/Screenshot-2024-03-31-at-23.58.08.png\" aria-label=\"Open full-size image: Sinhala instruction-following example from Aya-101\"><img src=\"https://ramith.fyi/assets/posts/2024-02-12-an-open-science-journey/Screenshot-2024-03-31-at-23.58.08.png\" alt=\"Sinhala instruction-following example from Aya-101\" loading=\"lazy\"></a></div></div><figcaption>(You can try the Aya-101 model here – <a href=\"https://huggingface.co/spaces/Tonic/Aya\">https://huggingface.co/spaces/Tonic/Aya</a>)<span>Screenshot by Ramith Hettiarachchi of the Aya-101 demo hosted at Tonic/Aya on Hugging Face. <a href=\"https://huggingface.co/spaces/Tonic/Aya\">Source</a>.</span></figcaption></figure><p>—</p><h3>The Start</h3><p>If I recall correctly, during my final year of undergrad, I joined C4AI (Cohere For AI<span role=\"math\"><img src=\"https://ramith.fyi/feed-assets/4c22257bd63b615f03eeca5affc99d157539c427c7b50749233ae19938b7156a.svg\" alt=\"Typeset mathematical expression\" width=\"15.03\" height=\"10.02\"></span>) discord server. I saw so many wonderful initiatives by this community to help students/researchers who wanted to learn about AI and ultimately contribute to research. I didn’t follow these initiatives closely due to other time commitments. But every once in a while, I would check out the cool initiatives of this community.</p><p><span role=\"math\"><img src=\"https://ramith.fyi/feed-assets/4c22257bd63b615f03eeca5affc99d157539c427c7b50749233ae19938b7156a.svg\" alt=\"Typeset mathematical expression\" width=\"15.03\" height=\"10.02\"></span>Cohere for AI is a non-profit driven by researchers all over the world with the mission of solving complex machine-learning problems.</p><p>—</p><h4>Filling out a Google Form (May 2023)</h4><figure><a href=\"https://ramith.fyi/assets/posts/2024-02-12-an-open-science-journey/IMG_8121-1.JPG\" aria-label=\"Open full-size image: A morning run in May 2023\"><img src=\"https://ramith.fyi/assets/posts/2024-02-12-an-open-science-journey/IMG_8121-1.JPG\" alt=\"A morning run in May 2023\" loading=\"lazy\"></a><figcaption><span>Photograph by Ramith Hettiarachchi.</span></figcaption></figure><p>On May 8th, I was getting ready for a morning run and saw this message on Discord.</p><figure><div><div><a href=\"https://ramith.fyi/assets/posts/2024-02-12-an-open-science-journey/IMG_8109-2.PNG\" aria-label=\"Open full-size image: Aya contributor signup form on a phone\"><img src=\"https://ramith.fyi/assets/posts/2024-02-12-an-open-science-journey/IMG_8109-2.PNG\" alt=\"Aya contributor signup form on a phone\" loading=\"lazy\"></a></div><div><a href=\"https://ramith.fyi/assets/posts/2024-02-12-an-open-science-journey/Screenshot-2024-02-13-at-00.40.28-3.png\" aria-label=\"Open full-size image: Discord invitation to contribute to Project Aya\"><img src=\"https://ramith.fyi/assets/posts/2024-02-12-an-open-science-journey/Screenshot-2024-02-13-at-00.40.28-3.png\" alt=\"Discord invitation to contribute to Project Aya\" loading=\"lazy\"></a></div></div><figcaption>(Suprisingly I had taken a screenshot of the Google Form (left picture) on that day, lucky for that, I can include it in this blog post!)<span>Aya contributor registration form by Cohere For AI; screenshot by Ramith Hettiarachchi.</span><span>Aya project invitation posted on Discord by Deividas Mataciunas; screenshot by Ramith Hettiarachchi.</span></figcaption></figure><p>—</p><p>When filling something up, I always think whether it is something I can do given my other commitments<span role=\"math\"><img src=\"https://ramith.fyi/feed-assets/146c579653eb92cf0b59169294d3ac66bf20b08144752d106157babc3e6fd0b9.svg\" alt=\"Typeset mathematical expression\" width=\"6.51\" height=\"10.02\"></span> 😅</p><p>I knew I didn’t have much time to dedicate, but the message above seemed reasonable so I filled it out. It seemed like only knowing the language was enough. Words like<code>multilingual</code>and<code>underrepresented languages</code>made it so tempting to fill out the Google form.</p><p><span role=\"math\"><img src=\"https://ramith.fyi/feed-assets/146c579653eb92cf0b59169294d3ac66bf20b08144752d106157babc3e6fd0b9.svg\" alt=\"Typeset mathematical expression\" width=\"6.51\" height=\"10.02\"></span> During undergrad, there are many occasions when I took too many things to my plate..</p><p>During high-school I used to make apps for Sinhala transliteration-<a href=\"https://archive.org/details/sinhala\">link</a> . So I have a softspot for tool that advance the usage of my native language.</p><p>—</p><h4>An Email ✉️</h4><p>June, 2023 was a great month, I was finishing up some experiments for my ICML 2023 workshop paper, and writing the paper. And then I received this email..</p><figure><a href=\"https://ramith.fyi/assets/posts/2024-02-12-an-open-science-journey/Screenshot-2024-02-13-at-00.06.32.png\" aria-label=\"Open full-size image: Email invitation to represent Sinhala in Project Aya\"><img src=\"https://ramith.fyi/assets/posts/2024-02-12-an-open-science-journey/Screenshot-2024-02-13-at-00.06.32.png\" alt=\"Email invitation to represent Sinhala in Project Aya\" loading=\"lazy\"></a><figcaption><span>Aya project invitation email; screenshot by Ramith Hettiarachchi.</span></figcaption></figure><p>it was sort of unexpected.. felt serious, but then again I felt like it’s something I’m capable of doing during my free time (a weekly meeting, spreading info about this project sounded good and doable 🤷🏻‍♂️).</p><p>So I replied that I’d want to help out to represent my native language! <span role=\"math\"><img src=\"https://ramith.fyi/feed-assets/bd6f74fe981f6c83f3ad204b96d64df2093aeeb5953241441316cdf821a192db.svg\" alt=\"Typeset mathematical expression\" width=\"6.51\" height=\"10.02\"></span>.</p><p><span role=\"math\"><img src=\"https://ramith.fyi/feed-assets/bd6f74fe981f6c83f3ad204b96d64df2093aeeb5953241441316cdf821a192db.svg\" alt=\"Typeset mathematical expression\" width=\"6.51\" height=\"10.02\"></span> After all I was missing volunteering after completing my undergrad too… so felt that this would be nice..</p><h3>Journey as a Language Ambassador</h3><p>I attended the first meeting where I got introduced to Project Aya. The presentation was incredible… I thought to myself, “a great research group with a clear vision of what they want to achieve in 2023..”. There was so much positivity and hope within this community, and I loved that energy!</p><h4>Somewhat of a rough start for Sinhala 🤕</h4><p>Now it was my turn to contribute to my language.  I remember going to the Aya annotation platform<span role=\"math\"><img src=\"https://ramith.fyi/feed-assets/d0ca01ab81c021915a2f3e3d0d35466c50ebf756c4d7989c5539ab714c84e30c.svg\" alt=\"Typeset mathematical expression\" width=\"7.7\" height=\"10.02\"></span>, and filling out my details (such as languages I speak).</p><p>I was surprised to see Sinhala prompts and completions 😃, but soon I realized that they are machine translations which most often did not make much sense 🤕 (see left side of the below picture for some context).</p><p><span role=\"math\"><img src=\"https://ramith.fyi/feed-assets/d0ca01ab81c021915a2f3e3d0d35466c50ebf756c4d7989c5539ab714c84e30c.svg\" alt=\"Typeset mathematical expression\" width=\"7.7\" height=\"10.02\"></span> Where human contributions are collected.</p><figure><a href=\"https://ramith.fyi/assets/posts/2024-02-12-an-open-science-journey/Screenshot-2024-02-18-at-16.39.02.png\" aria-label=\"Open full-size image: Sinhala annotation examples on the Aya platform\"><img src=\"https://ramith.fyi/assets/posts/2024-02-12-an-open-science-journey/Screenshot-2024-02-18-at-16.39.02.png\" alt=\"Sinhala annotation examples on the Aya platform\" loading=\"lazy\"></a><figcaption></figcaption></figure><p>So, we gradually started to refine those. Soon with the help of many Sinhala contributors, we got a massive pool of prompts and completions that we kept on refining.</p><h4>Realizing that we need to speed up</h4><p>From June to the end of September, we gained a lot of contributions, but soon, we realized our pace was too slow 😬. So what we did was to visualize <span role=\"math\"><img src=\"https://ramith.fyi/feed-assets/d0ca01ab81c021915a2f3e3d0d35466c50ebf756c4d7989c5539ab714c84e30c.svg\" alt=\"Typeset mathematical expression\" width=\"7.7\" height=\"10.02\"></span> our goal and work towards it. Furthermore, we spread out the message through many contributors (kudos to Jalina, Chamod, Nawoda, and Chanuka)</p><p><span role=\"math\"><img src=\"https://ramith.fyi/feed-assets/d0ca01ab81c021915a2f3e3d0d35466c50ebf756c4d7989c5539ab714c84e30c.svg\" alt=\"Typeset mathematical expression\" width=\"7.7\" height=\"10.02\"></span> Our goal was to reach 5000 re-annotations and 4000 original annotations</p><figure><a href=\"https://ramith.fyi/assets/posts/2024-02-12-an-open-science-journey/Screenshot-2024-02-18-at-17.25.57.png\" aria-label=\"Open full-size image: Discord message outlining Sinhala annotation goals\"><img src=\"https://ramith.fyi/assets/posts/2024-02-12-an-open-science-journey/Screenshot-2024-02-18-at-17.25.57.png\" alt=\"Discord message outlining Sinhala annotation goals\" loading=\"lazy\"></a><figcaption>(a discord message from the Aya Server)<span>Aya Sinhala contribution-progress message and charts by Ramith Hettiarachchi.</span></figcaption></figure><h3>So we accelerated our pace! 🇱🇰</h3><p>For the next remaining 3 months, all Sinhala contributors helped immensely to reach our goals – we even surpassed our original goals!</p><p>The pictures below capture some of the initiatives we took to gather more contributors..</p><figure><div><div><a href=\"https://ramith.fyi/assets/posts/2024-02-12-an-open-science-journey/Aya---Dec-15---Closing-the-Contribution-Chapter-30--dragged-.png\" aria-label=\"Open full-size image: Sinhala contributor outreach presentation, slide 30\"><img src=\"https://ramith.fyi/assets/posts/2024-02-12-an-open-science-journey/Aya---Dec-15---Closing-the-Contribution-Chapter-30--dragged-.png\" alt=\"Sinhala contributor outreach presentation, slide 30\" loading=\"lazy\"></a></div><div><a href=\"https://ramith.fyi/assets/posts/2024-02-12-an-open-science-journey/Aya---Dec-15---Closing-the-Contribution-Chapter-31--dragged-.png\" aria-label=\"Open full-size image: Sinhala contributor outreach presentation, slide 31\"><img src=\"https://ramith.fyi/assets/posts/2024-02-12-an-open-science-journey/Aya---Dec-15---Closing-the-Contribution-Chapter-31--dragged-.png\" alt=\"Sinhala contributor outreach presentation, slide 31\" loading=\"lazy\"></a></div></div><div><div><a href=\"https://ramith.fyi/assets/posts/2024-02-12-an-open-science-journey/Aya---Dec-15---Closing-the-Contribution-Chapter-32--dragged-.png\" aria-label=\"Open full-size image: Sinhala contributor outreach presentation, slide 32\"><img src=\"https://ramith.fyi/assets/posts/2024-02-12-an-open-science-journey/Aya---Dec-15---Closing-the-Contribution-Chapter-32--dragged-.png\" alt=\"Sinhala contributor outreach presentation, slide 32\" loading=\"lazy\"></a></div><div><a href=\"https://ramith.fyi/assets/posts/2024-02-12-an-open-science-journey/Aya---Dec-15---Closing-the-Contribution-Chapter-33--dragged-.png\" aria-label=\"Open full-size image: Sinhala contributor outreach presentation, slide 33\"><img src=\"https://ramith.fyi/assets/posts/2024-02-12-an-open-science-journey/Aya---Dec-15---Closing-the-Contribution-Chapter-33--dragged-.png\" alt=\"Sinhala contributor outreach presentation, slide 33\" loading=\"lazy\"></a></div></div><figcaption></figcaption></figure><p>—</p><figure><div><div><a href=\"https://ramith.fyi/assets/posts/2024-02-12-an-open-science-journey/IMG_5904-1.webp\" aria-label=\"Open full-size image: Commemorative chip with Aya Sinhala contributor names\"><img src=\"https://ramith.fyi/assets/posts/2024-02-12-an-open-science-journey/IMG_5904-1.webp\" alt=\"Commemorative chip with Aya Sinhala contributor names\" loading=\"lazy\"></a></div><div><a href=\"https://ramith.fyi/assets/posts/2024-02-12-an-open-science-journey/IMG_5886.webp\" aria-label=\"Open full-size image: Another view of the Aya Sinhala contributors chip\"><img src=\"https://ramith.fyi/assets/posts/2024-02-12-an-open-science-journey/IMG_5886.webp\" alt=\"Another view of the Aya Sinhala contributors chip\" loading=\"lazy\"></a></div></div><figcaption>(a 1x1 inch chip fabricated with the names of Aya Sinhala Contributors as a memory)<span>Aya Sinhala contributor commemorative chip by Ramith Hettiarachchi</span></figcaption></figure><section role=\"doc-bibliography\"><h2>References</h2><ol><li id=\"ref-model\" data-paper-title=\"Aya Model: An Instruction Finetuned Open-Access Multilingual Language Model\"><a href=\"https://arxiv.org/abs/2402.07827\">“Aya Model: An Instruction Finetuned Open-Access Multilingual Language Model.”</a></li><li id=\"ref-dataset\" data-paper-title=\"Aya Dataset: An Open-Access Collection for Multilingual Instruction Tuning\"><a href=\"https://arxiv.org/abs/2402.06619\">“Aya Dataset: An Open-Access Collection for Multilingual Instruction Tuning.”</a></li></ol></section><footer>Unless otherwise noted, the original text of this post is licensed under the <a href=\"https://creativecommons.org/licenses/by/4.0/\">Creative Commons Attribution 4.0 International License</a>. Separately credited material may have different rights. <a href=\"https://ramith.fyi/license/\">Licensing details</a>.</footer>",
      "date_published": "2024-02-12T00:00:00Z",
      "authors": [
        {
          "name": "Ramith Hettiarachchi",
          "url": "https://ramith.fyi"
        }
      ],
      "language": "en",
      "tags": [
        "scholarly"
      ]
    },
    {
      "id": "https://ramith.fyi/posts/2023-06-24-differentiable-search-evolutionary-trees/",
      "url": "https://ramith.fyi/posts/2023-06-24-differentiable-search-evolutionary-trees/",
      "title": "Differentiable Search of Evolutionary Trees from Leaves — ICML 2023 Workshop Paper",
      "content_html": "<h2>Differentiable Search of Evolutionary Trees from Leaves — ICML 2023 Workshop Paper</h2><div data-title=\"Differentiable Search of Evolutionary Trees from Leaves — ICML 2023 Workshop Paper\" data-slug=\"2023-06-24-differentiable-search-evolutionary-trees\" data-authors=\"Ramith Hettiarachchi\" data-date-published=\"2023-06-24\" data-language=\"en\" data-status=\"published\" data-license=\"CC-BY-4.0\" data-collections=\"scholarly; workshop paper; phylogenetics; differentiable programming\" data-doi=\"\"><p>By Ramith Hettiarachchi ⋅ Published <time datetime=\"2023-06-24\">2023-06-24</time></p></div><blockquote aria-label=\"ICML 2023 workshop paper and resources\"><p>ICML 2023 workshop paper</p><h3>Differentiable Search of Evolutionary Trees from Leaves</h3><p>Ramith Hettiarachchi, Avi Z. Swartz, Sergey Ovchinnikov</p><p>ICML 2023 workshops: Differentiable Almost Everything (DiffAE) and Sampling and Optimization in Discrete Space (SODS)</p><div>This page collects the workshop paper and its supporting resources. The paper contains the complete method, experiments, and claims.</div><p aria-label=\"Research artifacts\"><a href=\"https://doi.org/10.1101/2023.07.23.550206\">Read paper ↗</a> <a href=\"https://ramith.fyi/assets/pdf/Diff-Evol-Trees_ICML.pdf\">View poster ↗</a> <a href=\"https://github.com/ramithuh/diff-evol-tree-search\">Browse code ↗</a> <a href=\"https://ericmjl.github.io/blog/2023/8/7/journal-club-differentiable-search-of-evolutionary-trees/\">External explainer ↗</a> </p></blockquote><blockquote><div aria-hidden=\"true\">💡</div><div><strong>In one sentence:</strong> We relax the discrete choices behind a phylogenetic tree so that its topology and unknown ancestral sequences can be improved together using gradients.</div></blockquote><h3>Related paper</h3><p>Hettiarachchi, R., Swartz, A. Z., and Ovchinnikov, S. “Differentiable Search of Evolutionary Trees from Leaves.” ICML 2023 Workshops: DiffAE and SODS. DOI: <a href=\"https://doi.org/10.1101/2023.07.23.550206\">10.1101/2023.07.23.550206</a></p><footer>Unless otherwise noted, the original text of this post is licensed under the <a href=\"https://creativecommons.org/licenses/by/4.0/\">Creative Commons Attribution 4.0 International License</a>. Separately credited material may have different rights. <a href=\"https://ramith.fyi/license/\">Licensing details</a>.</footer>",
      "date_published": "2023-06-24T00:00:00Z",
      "authors": [
        {
          "name": "Ramith Hettiarachchi",
          "url": "https://ramith.fyi"
        }
      ],
      "language": "en",
      "tags": [
        "scholarly",
        "workshop paper",
        "phylogenetics",
        "differentiable programming"
      ]
    },
    {
      "id": "https://ramith.fyi/posts/2023-02-10-esm-2-evolutionary-scale-prediction-of-atomic-level-protein-structure-with-a-language-model/",
      "url": "https://ramith.fyi/posts/2023-02-10-esm-2-evolutionary-scale-prediction-of-atomic-level-protein-structure-with-a-language-model/",
      "title": "ESM-2 (evolutionary-scale prediction of atomic level protein structure with a language model)",
      "content_html": "<h2>ESM-2 (evolutionary-scale prediction of atomic level protein structure with a language model)</h2><div data-title=\"ESM-2 (evolutionary-scale prediction of atomic level protein structure with a language model)\" data-slug=\"2023-02-10-esm-2-evolutionary-scale-prediction-of-atomic-level-protein-structure-with-a-language-model\" data-authors=\"Ramith Hettiarachchi\" data-date-published=\"2023-02-10\" data-language=\"en\" data-status=\"published\" data-license=\"CC-BY-4.0\" data-collections=\"scholarly\" data-doi=\"\"><p>By Ramith Hettiarachchi ⋅ Published <time datetime=\"2023-02-10\">2023-02-10</time></p></div><blockquote><div aria-hidden=\"true\">✏️</div><div><em>I write these paper “summaries” for me to clearly understand the paper by summarizing the paper and synthesizing the literature. I hope they might be helpful to some readers too. If you have feedback, please write to <a href=\"mailto:hello@ramith.fyi\">hello@ramith.fyi</a>.</em></div></blockquote><h3>Highlights of the ESM-2 Paper</h3><blockquote><div aria-hidden=\"true\">💡</div><div><ul><li>Train protein language models up to 15B parameters.<sup><a href=\"#fn-1\" id=\"fnref-1\">[Note 1]</a></sup></li><li>Infer structure directly from a primary sequence using a language model.</li><li>Leverage evolutionary patterns captured by the language model to produce atomic-level predictions.</li><li>Achieve an order-of-magnitude speedup—up to 60×—in high-resolution structure prediction.</li><li>Present the ESM Metagenomic Atlas: structural characterization of more than 617 million metagenomic proteins.<sup><a href=\"#fn-2\" id=\"fnref-2\">[Note 2]</a></sup><sup><a href=\"#fn-3\" id=\"fnref-3\">[Note 3]</a></sup></li></ul></div></blockquote><h3>1. Introduction</h3><h4>1.1 — Structure and function are hidden in sequences</h4><p>Biological properties of proteins influence which positions in a sequence can undergo mutations. From these observations, we can identify evolutionary patterns such as coevolution and conservation of amino acids. These patterns can help us infer properties of protein function and structure.<sup><a href=\"#fn-4\" id=\"fnref-4\">[Note 4]</a></sup></p><p>Usually, we align sequences before drawing conclusions about function and structure. This intermediate representation, known as a <em>multiple sequence alignment (MSA)</em>, has a high time complexity because we must first search for related sequences and then align them.<sup><a href=\"#fn-5\" id=\"fnref-5\">[Note 5]</a></sup></p><p>What if we can get rid of this intermediate representation? That’s one aspect this paper accomplishes.</p><h4>1.2 — Large language models (LLMs)</h4><p>Historically, language models were pretrained using objectives such as predicting the next word in a sentence. Devlin et al.‘s <a href=\"https://arxiv.org/abs/1810.04805\">BERT</a> showed that masking some input tokens and predicting them—the masked-language-model objective, or MLM—is an effective pretraining strategy.<sup><a href=\"#fn-6\" id=\"fnref-6\">[Note 6]</a></sup></p><h4>1.3 — Contributions</h4><p>Inspired by this widely adopted strategy, the authors hypothesise that filling in missing amino acids might produce representations rich enough to infer structure. They therefore <strong>scale protein language models from 8 million parameters up to 15 billion parameters</strong>. Doing so reveals the following:</p><ul><li>Atomic-level structure prediction directly from sequence.</li><li>A strong correlation between perplexity and structure-prediction accuracy.</li><li>Up to 60× faster inference.</li><li><strong>No need to search</strong> for related sequences.</li></ul><p>Because this approach improves speed by one to two orders of magnitude and does not need an MSA, the authors expand structure prediction to the much larger and more diverse space of metagenomic proteins. In summary, they:</p><ul><li><p>Predict structures for more than 617 million sequences in MGnify90.<sup><a href=\"#fn-7\" id=\"fnref-7\">[Note 7]</a></sup></p><ul><li><p>Of those structures, 225 million are high-confidence predictions.</p><ul><li>76.8% are disjoint from UniRef90 at 90% sequence identity.</li><li>12.6% have no experimental ground truth.</li></ul></li></ul></li></ul><div><p>Open <a href=\"https://esmatlas.com/explore\">ESM Metagenomic Atlas explorer</a> in a new tab.</p></div><h3>2. Method</h3><h4>2.1 — How does structure emerge from a language model trained on sequences?</h4><p>The ESM-2 language model is trained with approximately 65 million unique sequences.<sup><a href=\"#fn-8\" id=\"fnref-8\">[Note 8]</a></sup> Because the MLM objective asks the model to predict missing amino acids using their neighboring context, the model must learn interdependencies between amino acids. Previous work—<a href=\"#ref-transformer\" role=\"doc-biblioref\">[2]</a> and <a href=\"#ref-contacts\" role=\"doc-biblioref\">[3]</a>—showed that Transformer models trained with MLM on protein sequences develop attention patterns that correspond to residue-residue contact maps.<sup><a href=\"#fn-9\" id=\"fnref-9\">[Note 9]</a></sup></p><p>After training the language model, the authors use the approach from <a href=\"#ref-contacts\" role=\"doc-biblioref\">[3]</a> to compute contact maps from attention patterns. A logistic regression identifies contacts as follows.</p><figure><a href=\"https://ramith.fyi/assets/posts/2023-02-10-esm-2-evolutionary-scale-prediction-of-atomic-level-protein-structure-with-a-language-model/contact-prediction-pipeline.png\" aria-label=\"Open full-size image: Annotated contact-prediction pipeline from Transformer attention maps\"><img src=\"https://ramith.fyi/assets/posts/2023-02-10-esm-2-evolutionary-scale-prediction-of-atomic-level-protein-structure-with-a-language-model/contact-prediction-pipeline.png\" alt=\"Annotated contact-prediction pipeline from Transformer attention maps\" loading=\"lazy\"></a><figcaption>Attention maps from a masked protein language model are symmetrized and passed to logistic regression to predict residue-residue contacts. <span>Contact-prediction pipeline figure from Rao et al. (2020); annotations by Ramith Hettiarachchi. <a href=\"https://doi.org/10.1101/2020.12.15.422761\">Source</a>.</span></figcaption></figure><h4>2.2 — What about atomic-level structure? (Enter ESMFold)</h4><p>The authors extract contact maps from attention patterns, but predicting atomic spatial coordinates requires an equivariant Transformer. They use the <a href=\"https://ramith.fyi/assets/posts/2023-02-10-esm-2-evolutionary-scale-prediction-of-atomic-level-protein-structure-with-a-language-model/alphafold-structure-module.png\" data-image-alt=\"Annotated AlphaFold structure module and invariant point attention diagram\" data-image-caption=\"AlphaFold structure module and invariant point attention.\"><em>structure module</em></a> introduced in <a href=\"https://doi.org/10.1038/s41586-021-03819-2\">AlphaFold</a>. This module projects atomic spatial coordinates from the language model’s internal representation. The complete architecture is called ESMFold.</p><p><em>Steps in ESMFold</em></p><ol><li value=\"1\">Process the sequence through ESM-2.</li><li value=\"2\">Pass the representation learned by ESM-2 through a series of <em>folding blocks</em>. Each block <a href=\"https://ramith.fyi/assets/posts/2023-02-10-esm-2-evolutionary-scale-prediction-of-atomic-level-protein-structure-with-a-language-model/esmfold-folding-trunk-code.png\" data-image-alt=\"Annotated ESMFold folding-trunk and triangular-attention source code\" data-image-caption=\"Folding-trunk code mapped to the triangular self-attention block.\">sequentially updates</a> a sequence representation and a pairwise representation.</li><li value=\"3\">Pass the result to the structure module.</li><li value=\"4\">Repeat with three recycling steps. <a href=\"https://ramith.fyi/assets/posts/2023-02-10-esm-2-evolutionary-scale-prediction-of-atomic-level-protein-structure-with-a-language-model/esmfold-recycling-code.png\" data-image-alt=\"Annotated ESMFold trunk code showing folding, structure prediction, and recycling\" data-image-caption=\"ESMFold folding-block iteration, structure-module call, and recycling.\">View annotated code.</a></li></ol><figure><a href=\"https://ramith.fyi/assets/posts/2023-02-10-esm-2-evolutionary-scale-prediction-of-atomic-level-protein-structure-with-a-language-model/esmfold-architecture.png\" aria-label=\"Open full-size image: ESMFold architecture with ESM-2, folding trunk, structure module, and recycling\"><img src=\"https://ramith.fyi/assets/posts/2023-02-10-esm-2-evolutionary-scale-prediction-of-atomic-level-protein-structure-with-a-language-model/esmfold-architecture.png\" alt=\"ESMFold architecture with ESM-2, folding trunk, structure module, and recycling\" loading=\"lazy\"></a><figcaption>ESMFold architecture: ESM-2 representations pass through a folding trunk and an AlphaFold-derived structure module, with recycling. <span>ESMFold architecture figure from Lin et al. (2022); annotations by Ramith Hettiarachchi. <a href=\"https://doi.org/10.1101/2022.07.20.500902\">Source</a>.</span></figcaption></figure><p>The supporting figures connect the structure-module diagram to implementation details. Select any image to open the full-resolution version.</p><div><figure><a href=\"https://ramith.fyi/assets/posts/2023-02-10-esm-2-evolutionary-scale-prediction-of-atomic-level-protein-structure-with-a-language-model/alphafold-structure-module.png\" aria-label=\"Open full-size image: Annotated AlphaFold structure module and invariant point attention diagram\"><img src=\"https://ramith.fyi/assets/posts/2023-02-10-esm-2-evolutionary-scale-prediction-of-atomic-level-protein-structure-with-a-language-model/alphafold-structure-module.png\" alt=\"Annotated AlphaFold structure module and invariant point attention diagram\" loading=\"lazy\"></a><figcaption>AlphaFold’s structure module and invariant point attention. <span>AlphaFold structure-module figures adapted from Jumper et al. (2021), “Highly accurate protein structure prediction with AlphaFold” (CC BY 4.0); annotations by Ramith Hettiarachchi. <a href=\"https://doi.org/10.1038/s41586-021-03819-2\">Source</a>. <a href=\"https://creativecommons.org/licenses/by/4.0/\">License</a>.</span></figcaption></figure><figure><a href=\"https://ramith.fyi/assets/posts/2023-02-10-esm-2-evolutionary-scale-prediction-of-atomic-level-protein-structure-with-a-language-model/esmfold-folding-trunk-code.png\" aria-label=\"Open full-size image: Annotated ESMFold folding-trunk and triangular-attention source code\"><img src=\"https://ramith.fyi/assets/posts/2023-02-10-esm-2-evolutionary-scale-prediction-of-atomic-level-protein-structure-with-a-language-model/esmfold-folding-trunk-code.png\" alt=\"Annotated ESMFold folding-trunk and triangular-attention source code\" loading=\"lazy\"></a><figcaption>Mapping the folding trunk to its triangular self-attention block. <span>ESMFold folding-trunk and triangular-attention source code from the Meta ESM repository (MIT license); screenshot and annotations by Ramith Hettiarachchi. <a href=\"https://github.com/facebookresearch/esm/blob/main/esm/esmfold/v1/trunk.py\">Source</a>. <a href=\"https://github.com/facebookresearch/esm/blob/main/LICENSE\">License</a>.</span></figcaption></figure><figure><a href=\"https://ramith.fyi/assets/posts/2023-02-10-esm-2-evolutionary-scale-prediction-of-atomic-level-protein-structure-with-a-language-model/esmfold-recycling-code.png\" aria-label=\"Open full-size image: Annotated ESMFold trunk code showing folding, structure prediction, and recycling\"><img src=\"https://ramith.fyi/assets/posts/2023-02-10-esm-2-evolutionary-scale-prediction-of-atomic-level-protein-structure-with-a-language-model/esmfold-recycling-code.png\" alt=\"Annotated ESMFold trunk code showing folding, structure prediction, and recycling\" loading=\"lazy\"></a><figcaption>Folding-block iteration, the structure-module call, and recycling. <span>ESMFold recycling source code from the Meta ESM repository (MIT license); screenshot and annotations by Ramith Hettiarachchi. <a href=\"https://github.com/facebookresearch/esm/blob/main/esm/esmfold/v1/trunk.py\">Source</a>. <a href=\"https://github.com/facebookresearch/esm/blob/main/LICENSE\">License</a>.</span></figcaption></figure></div><p><strong>Training:</strong> To train the structure model to obtain spatial coordinates, the authors use experimentally determined structures from the <a href=\"https://www.rcsb.org/\">Protein Data Bank</a>—approximately 25,000 clusters covering around 325,000 structures. This is augmented with 12 million structures predicted by AlphaFold2.<sup><a href=\"#fn-10\" id=\"fnref-10\">[Note 10]</a></sup></p><p><strong>Evaluation:</strong> 194 CAMEO proteins and 51 CASP14 proteins.</p><p>This language model based approach vastly simplifies the usual SOTA structure prediction process by eliminating the need for the following <span role=\"math\"><img src=\"https://ramith.fyi/feed-assets/bd6f74fe981f6c83f3ad204b96d64df2093aeeb5953241441316cdf821a192db.svg\" alt=\"Typeset mathematical expression\" width=\"6.51\" height=\"10.02\"></span>,</p><ul><li>External evolutionary databases</li><li>Multiple sequence alignments (MSAs)</li><li>Templates</li></ul><p>For example, <a href=\"https://doi.org/10.1038/s41586-021-03819-2\">AlphaFold</a> requires access to these resources.</p><h3>3. Results</h3><h4>3.1 — How well does it predict structures?</h4><p>As mentioned before, they evaluate performance on CAMEO and CASP14 proteins and check how well the structure was predicted using the TM-Score.</p><p>In predicting the structure just by single sequences, ESMFold achieves very good performance compared to AlphaFold and RoseTTAFold.</p><figure><a href=\"https://ramith.fyi/assets/posts/2023-02-10-esm-2-evolutionary-scale-prediction-of-atomic-level-protein-structure-with-a-language-model/esmfold-structure-performance.png\" aria-label=\"Open full-size image: ESMFold, AlphaFold2, and RoseTTAFold TM-score comparisons on CAMEO and CASP14\"><img src=\"https://ramith.fyi/assets/posts/2023-02-10-esm-2-evolutionary-scale-prediction-of-atomic-level-protein-structure-with-a-language-model/esmfold-structure-performance.png\" alt=\"ESMFold, AlphaFold2, and RoseTTAFold TM-score comparisons on CAMEO and CASP14\" loading=\"lazy\"></a><figcaption>Single-sequence and full-pipeline TM-score comparisons on CAMEO and CASP14; point color encodes perplexity. <span>Structure-prediction performance, Figure 2B from Lin et al. (2022); annotations by Ramith Hettiarachchi. <a href=\"https://doi.org/10.1101/2022.07.20.500902\">Source</a>.</span></figcaption></figure><h4>3.2 — How important is the language model in the pipeline?</h4><p>The key question that arises is <strong>how important is the representation learnt by the LM for the task of structure prediction</strong> . To quantify this we need several metrics.</p><p>First, we need to characterize how well the language model understands protein sequences. This is where perplexity comes in. We already have the TM-score to measure how closely a predicted structure matches the ground truth.</p><p><strong>Thus, the graph to the right in Fig. 2B shows that,</strong></p><ul><li><strong>High ESMFold TM-Scores</strong> have <strong>low perplexity</strong> scores (numerically speaking, on CAMEO, Pearson correlation coefficient is −0.55 and in CASP14 it’s −0.67)</li></ul><blockquote><div aria-hidden=\"true\">✏️</div><div><p><strong>What’s perplexity?</strong></p><p>Perplexity describes how well a language model can predict a protein sequence. It ranges from 1 for a perfect model to 20 for random predictions; intuitively, it is the number of amino acids the model is choosing between at each prediction.</p></div></blockquote><h5>How can we achieve lower perplexity?</h5><p>We now know that a <em>better language model representation</em>—with lower perplexity—leads to better structure prediction. How can we obtain a better representation? 🤔 Is scaling all you need?</p><p>To answer this question, authors explore the effect of scaling and look at what happens to the following :</p><ul><li>Precision @ L</li><li>Change in perplexity</li></ul><figure><a href=\"https://ramith.fyi/assets/posts/2023-02-10-esm-2-evolutionary-scale-prediction-of-atomic-level-protein-structure-with-a-language-model/esm2-scaling-contact-precision.png\" aria-label=\"Open full-size image: Scatter plots comparing long-range contact precision across ESM-2 model sizes\"><img src=\"https://ramith.fyi/assets/posts/2023-02-10-esm-2-evolutionary-scale-prediction-of-atomic-level-protein-structure-with-a-language-model/esm2-scaling-contact-precision.png\" alt=\"Scatter plots comparing long-range contact precision across ESM-2 model sizes\" loading=\"lazy\"></a><figcaption>Effect of scaling ESM-2 on long-range contact precision; point color shows the change in perplexity. <span>ESM-2 scaling and contact precision, Figure 1D from Lin et al. (2022); annotations by Ramith Hettiarachchi. <a href=\"https://doi.org/10.1101/2022.07.20.500902\">Source</a>.</span></figcaption></figure><p>The authors plot how long-range precision at L changes when moving from a smaller model on the x-axis to a larger model on the y-axis. Points above the diagonal suggest that scaling improves <em>long-range precision at L</em> for some proteins.</p><h5>Is scaling the answer?</h5><p>It is not that simple. Although P@L increases with scale for some proteins, the number of evolutionarily related sequences tells another story. Language models struggle when less relevant training data is available for a query. This is intuitive—more study, better results—but does it reflect memorization rather than understanding?</p><figure><a href=\"https://ramith.fyi/assets/posts/2023-02-10-esm-2-evolutionary-scale-prediction-of-atomic-level-protein-structure-with-a-language-model/esm2-sequence-depth-contact-precision.png\" aria-label=\"Open full-size image: Long-range contact precision plotted against the number of related sequences\"><img src=\"https://ramith.fyi/assets/posts/2023-02-10-esm-2-evolutionary-scale-prediction-of-atomic-level-protein-structure-with-a-language-model/esm2-sequence-depth-contact-precision.png\" alt=\"Long-range contact precision plotted against the number of related sequences\" loading=\"lazy\"></a><figcaption>Long-range precision at L as a function of the number of related sequences for several ESM-2 model sizes. <span>Sequence depth and contact-precision figure from Lin et al. (2022); annotations by Ramith Hettiarachchi. <a href=\"https://doi.org/10.1101/2022.07.20.500902\">Source</a>.</span></figcaption></figure><p>The authors could have used a different color scheme: white points indicate no change in perplexity, while a point on the diagonal indicates no improvement in long-range precision at L.<sup><a href=\"#fn-11\" id=\"fnref-11\">[Note 11]</a></sup></p><h4>3.3 — What about prediction speed?</h4><ul><li>A protein with 384 residues on one NVIDIA V100 GPU: 14.2 seconds.<sup><a href=\"#fn-12\" id=\"fnref-12\">[Note 12]</a></sup></li><li>Shorter sequences  60x speedup</li></ul><figure><a href=\"https://ramith.fyi/assets/posts/2023-02-10-esm-2-evolutionary-scale-prediction-of-atomic-level-protein-structure-with-a-language-model/esmfold-inference-speed.png\" aria-label=\"Open full-size image: Log-scale inference time comparison for ESMFold, AlphaFold, and RoseTTAFold\"><img src=\"https://ramith.fyi/assets/posts/2023-02-10-esm-2-evolutionary-scale-prediction-of-atomic-level-protein-structure-with-a-language-model/esmfold-inference-speed.png\" alt=\"Log-scale inference time comparison for ESMFold, AlphaFold, and RoseTTAFold\" loading=\"lazy\"></a><figcaption>Inference time versus sequence length. ESMFold is fastest for shorter sequences, while its pair representation makes long sequences more expensive. MSA search time for the other methods is not included. <span>ESMFold inference-time plot from Lin et al; annotations by Ramith Hettiarachchi.</span></figcaption></figure><h4>3.4 — Comparison with other protein language models</h4><figure><a href=\"https://ramith.fyi/assets/posts/2023-02-10-esm-2-evolutionary-scale-prediction-of-atomic-level-protein-structure-with-a-language-model/esm2-model-comparison.png\" aria-label=\"Open full-size image: Table comparing ESM-2 sizes and other protein language models\"><img src=\"https://ramith.fyi/assets/posts/2023-02-10-esm-2-evolutionary-scale-prediction-of-atomic-level-protein-structure-with-a-language-model/esm2-model-comparison.png\" alt=\"Table comparing ESM-2 sizes and other protein language models\" loading=\"lazy\"></a><figcaption>Validation perplexity, long-range contact precision, and structure-prediction results across ESM-2 sizes and comparison protein language models. <span>Protein language-model comparison table from Lin et al. (2022); annotations by Ramith Hettiarachchi. <a href=\"https://doi.org/10.1101/2022.07.20.500902\">Source</a>.</span></figcaption></figure><h3>4. Conclusion</h3><p>It’s remarkable that these authors scale protein language models and it has resulted in learning structure hidden through databases of sequences, and thus we do not need to depend onto the MSA.</p><p>Is it because, the model has learnt to obtain the signal which we previously obtained through MSAs? What can we tell about the performance of sequences that had less number of evolutionary sequences in training data? why does it still struggle to obtain decent performance. It would be very interesting to analyze these directions.</p><p>Thanks for reading this, hope you found it useful. If you have any suggestions/ comments please share below.</p><section role=\"doc-bibliography\"><h2>References</h2><ol><li id=\"ref-esm\" data-paper-title=\"Evolutionary-scale prediction of atomic level protein structure with a language model\"><a href=\"https://doi.org/10.1101/2022.07.20.500902\">“Evolutionary-scale prediction of atomic level protein structure with a language model.”</a></li><li id=\"ref-transformer\" data-paper-title=\"BERTology Meets Biology: Interpreting Attention in Protein Language Models\"><a href=\"https://arxiv.org/abs/2006.15222\">“BERTology Meets Biology: Interpreting Attention in Protein Language Models.”</a></li><li id=\"ref-contacts\" data-paper-title=\"Transformer protein language models are unsupervised structure learners\"><a href=\"https://doi.org/10.1101/2020.12.15.422761\">“Transformer protein language models are unsupervised structure learners.”</a></li><li id=\"ref-discussion\" data-paper-title=\"Eric Wallace: discussion of protein language models\"><a href=\"https://twitter.com/Eric_Wallace_/status/1592929060539469824\">“Eric Wallace: discussion of protein language models.”</a></li></ol></section><footer>Unless otherwise noted, the original text of this post is licensed under the <a href=\"https://creativecommons.org/licenses/by/4.0/\">Creative Commons Attribution 4.0 International License</a>. Separately credited material may have different rights. <a href=\"https://ramith.fyi/license/\">Licensing details</a>.</footer><h2>Notes</h2><ol><li id=\"fn-1\"><sup><a href=\"#fnref-1\">1</a></sup> The largest language model for proteins at the time.</li><li id=\"fn-2\"><sup><a href=\"#fnref-2\">2</a></sup> Of these, 225 million were high-confidence predictions. See the <a href=\"https://esmatlas.com/\">ESM Metagenomic Atlas</a>.</li><li id=\"fn-3\"><sup><a href=\"#fnref-3\">3</a></sup> Metagenomics describes both sequencing DNA purified directly from a natural environment and the research field studying microbial communities in their natural state (Godzik, 2011).</li><li id=\"fn-4\"><sup><a href=\"#fnref-4\">4</a></sup> In essence, information about protein structure and function is hidden in sequences.</li><li id=\"fn-5\"><sup><a href=\"#fnref-5\">5</a></sup> The search process in AlphaFold and RoseTTAFold pipelines can take more than ten minutes.</li><li id=\"fn-6\"><sup><a href=\"#fnref-6\">6</a></sup> Unlike left-to-right pretraining, the MLM objective lets the representation combine both left and right context, enabling a deeply bidirectional Transformer (paraphrased from the BERT paper).</li><li id=\"fn-7\"><sup><a href=\"#fnref-7\">7</a></sup> This took two weeks on 2,000 GPUs. 🤯</li><li id=\"fn-8\"><sup><a href=\"#fnref-8\">8</a></sup> The sequences were sampled with even weighting across approximately 43 million UniRef50 training clusters.</li><li id=\"fn-9\"><sup><a href=\"#fnref-9\">9</a></sup> I plan to write a separate article about this work.</li><li id=\"fn-10\"><sup><a href=\"#fnref-10\">10</a></sup> During training, predicted structures are sampled 75% of the time and real structures 25% of the time.</li><li id=\"fn-11\"><sup><a href=\"#fnref-11\">11</a></sup> It would be useful if the plot made the proportion of proteins with improved performance directly visible, although that might make it too cluttered.</li><li id=\"fn-12\"><sup><a href=\"#fnref-12\">12</a></sup> This is a 6× speedup compared with AlphaFold2.</li></ol>",
      "date_published": "2023-02-10T00:00:00Z",
      "authors": [
        {
          "name": "Ramith Hettiarachchi",
          "url": "https://ramith.fyi"
        }
      ],
      "language": "en",
      "tags": [
        "scholarly"
      ]
    },
    {
      "id": "https://ramith.fyi/posts/2022-01-26-deep-residual-learning-for-image-recognition/",
      "url": "https://ramith.fyi/posts/2022-01-26-deep-residual-learning-for-image-recognition/",
      "title": "Deep Residual Learning for Image Recognition",
      "content_html": "<h2>Deep Residual Learning for Image Recognition</h2><div data-title=\"Deep Residual Learning for Image Recognition\" data-slug=\"2022-01-26-deep-residual-learning-for-image-recognition\" data-authors=\"Ramith Hettiarachchi\" data-date-published=\"2022-01-26\" data-language=\"en\" data-status=\"published\" data-license=\"CC-BY-4.0\" data-collections=\"scholarly\" data-doi=\"\"><p>By Ramith Hettiarachchi ⋅ Published <time datetime=\"2022-01-26\">2022-01-26</time></p></div><h3>Highlights of ResNet Paper</h3><p>Summary of He et al. <a href=\"#ref-resnet\" role=\"doc-biblioref\">[1]</a>.</p><ul><li>Present a <strong>residual learning framework</strong> to train very deep networks more easily.</li><li>Training 8x deeper networks than VGG-net</li><li>3.57% error on the ImageNet test set, 28% relative improvement on COCO object detection dataset.</li><li>Topping the leader board in ILSVRC &amp; COCO 2015 (ImageNet classification, detection, localization, COCO detection &amp; segmentation)</li></ul><h3>Introduction</h3><p>From the ImageNet Classification results in 2014-2015, it was evident that having deeper networks helps to learn greater levels of features. As shown in the figure below, we can see that VGG-Net and GoogLeNet have reduced the top-5 error rate further by having deeper networks.</p><p>So if we just stack more and more layers, does that help? Turns out it doesn’t. One reason for this is the <a href=\"https://people.idsia.ch/~juergen/fundamentaldeeplearningproblem.html\">vanishing gradient problem</a> which was studied by Sepp Hochreiter in 1991 and discussed over the years <a href=\"#ref-gradient\" role=\"doc-biblioref\">[2]</a>. This problem makes it difficult for a network to converge from the start. This issue has been addressed through various initialization methods and through batch normalization <a href=\"#ref-batchnorm\" role=\"doc-biblioref\">[3]</a>.</p><p>Even when a network starts converging, in deeper networks, researchers have found that there is a degradation of accuracy. Particularly, <em>when we start increasing the depth</em> of a model the accuracy gets saturated, and then <strong><em>it degrades rapidly</em></strong> . As  evident from the learning curves, this is not due to overfitting. Check the training-error curves in the left figure as depth increases in increments of 12.</p><p>—</p><figure><p><sup><a href=\"#feed-note-1\">[Note 1]</a></sup></p><img src=\"https://ramith.fyi/feed-assets/f085d0ad88fba5b5ea9420806762e1bcb78d3e0f3d6a9539ee383c1d830bc98e.png\"></figure><figure><p><sup><a href=\"#feed-note-2\">[Note 2]</a></sup></p><img src=\"https://ramith.fyi/feed-assets/8a6f245766e7a4c1fad9e3491fcd5e7218ab167491305f797475df00f24d3c4d.png\"></figure><p>—</p><p>The authors of the ResNet paper argue that, even if we increase the depth, theoretically there should be solution which gives the same accuracy. So it’s basically the shallow network + layers with identity transform.💡 Why can’t the added layers become an <strong>identity mapping 🤷🏻</strong> However, the problem seems that the optimizers cannot reach that solution. So can we do a trick and get there easily? That’s what authors hypothesize.</p><h3>Methodology - Deep Residual Learning</h3><h4>Fitting a residual mapping</h4><p><strong><span role=\"math\"><img src=\"https://ramith.fyi/feed-assets/83b116716e47411f1f1fbd5f322c8c4ffa04964c4591199d09ce96a740566535.svg\" alt=\"Typeset mathematical expression\" width=\"12.53\" height=\"10.02\"></span></strong> - Mapping that needs to be fit by <strong>few</strong> stacked layers<br><br><strong><span role=\"math\"><img src=\"https://ramith.fyi/feed-assets/f03df5b164ae6118ebf27ba0c88ac57a952ee2d29e1540de3d37a6da6067b465.svg\" alt=\"Typeset mathematical expression\" width=\"7.98\" height=\"10.02\"></span></strong> - input to the first of those layers</p><p><em>Let’s say we need to approximate the function</em> <span role=\"math\"><img src=\"https://ramith.fyi/feed-assets/83b116716e47411f1f1fbd5f322c8c4ffa04964c4591199d09ce96a740566535.svg\" alt=\"Typeset mathematical expression\" width=\"12.53\" height=\"10.02\"></span> by some set of layers of a neural network. The authors propose that, rather than learning <span role=\"math\"><img src=\"https://ramith.fyi/feed-assets/83b116716e47411f1f1fbd5f322c8c4ffa04964c4591199d09ce96a740566535.svg\" alt=\"Typeset mathematical expression\" width=\"12.53\" height=\"10.02\"></span>, the <em>few layers</em> approximate a <em>residual function</em> (<span role=\"math\"><img src=\"https://ramith.fyi/feed-assets/e9f9cb426972b56e08bc6efba41895ebfa06dae9e281c00786ce2352e5b5a57c.svg\" alt=\"Typeset mathematical expression\" width=\"38.43\" height=\"10.02\"></span>). 🤔</p><p>Let’s denote this new function by <span role=\"math\"><img src=\"https://ramith.fyi/feed-assets/66e75a1dedfe2609c4ae1067eb296cb00e8e9515b2533a5181a3bba32d4b22a5.svg\" alt=\"Typeset mathematical expression\" width=\"12.0\" height=\"10.02\"></span>. So, now we have rewritten original the function we need to approximate as, <span role=\"math\"><img src=\"https://ramith.fyi/feed-assets/960fb55b631b92363e66dab5435c9515eeeb3afa0bd5427c5d3391376536ce6c.svg\" alt=\"Typeset mathematical expression\" width=\"108.77\" height=\"10.02\"></span>.</p><p><strong>Ok, so what benefit does this give?  🤷🏻</strong></p><p>By reformulating, we saw was that, <span role=\"math\"><img src=\"https://ramith.fyi/feed-assets/83b116716e47411f1f1fbd5f322c8c4ffa04964c4591199d09ce96a740566535.svg\" alt=\"Typeset mathematical expression\" width=\"12.53\" height=\"10.02\"></span> was split into an addition of a function <span role=\"math\"><img src=\"https://ramith.fyi/feed-assets/66e75a1dedfe2609c4ae1067eb296cb00e8e9515b2533a5181a3bba32d4b22a5.svg\" alt=\"Typeset mathematical expression\" width=\"12.0\" height=\"10.02\"></span> with the input. In the degradation problem that we saw earlier, the issue was that learning the identity function was hard. However with this residual learning reformulation, it should be easy for the optimizer to drive the weights of the layers such that <span role=\"math\"><img src=\"https://ramith.fyi/feed-assets/66e75a1dedfe2609c4ae1067eb296cb00e8e9515b2533a5181a3bba32d4b22a5.svg\" alt=\"Typeset mathematical expression\" width=\"12.0\" height=\"10.02\"></span> becomes a zero mapping. Otherwise, deeper networks should have learnt the identity function in their added layers, giving similar accuracies. In this way, we are left with <span role=\"math\"><img src=\"https://ramith.fyi/feed-assets/aab2230694028ee377ca0b0846b8c0faff9178defb2d6557a2c5c20b36271385.svg\" alt=\"Typeset mathematical expression\" width=\"57.29\" height=\"10.02\"></span> which is the identity mapping.</p><p>—</p><figure><p><sup><a href=\"#feed-note-3\">[Note 3]</a></sup></p><img src=\"https://ramith.fyi/feed-assets/eda2a06358c968f7496fecdb126c2b98ceef3ef5020d1ded48523066d8b25b10.png\"></figure><section role=\"doc-bibliography\"><h2>References</h2><ol><li id=\"ref-resnet\" data-paper-title=\"Deep Residual Learning for Image Recognition\"><a href=\"https://arxiv.org/abs/1512.03385\">“Deep Residual Learning for Image Recognition.”</a></li><li id=\"ref-gradient\" data-paper-title=\"The fundamental deep learning problem\"><a href=\"https://people.idsia.ch/~juergen/fundamentaldeeplearningproblem.html\">“The fundamental deep learning problem.”</a></li><li id=\"ref-batchnorm\" data-paper-title=\"Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift\"><a href=\"https://arxiv.org/abs/1502.03167\">“Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift.”</a></li></ol></section><footer>Unless otherwise noted, the original text of this post is licensed under the <a href=\"https://creativecommons.org/licenses/by/4.0/\">Creative Commons Attribution 4.0 International License</a>. Separately credited material may have different rights. <a href=\"https://ramith.fyi/license/\">Licensing details</a>.</footer><h2>Notes</h2><ol><li id=\"feed-note-1\">Figure 1: <span>Training and test error plot from He, Zhang, Ren, and Sun, “Deep Residual Learning for Image Recognition” (CVPR 2016). <a href=\"https://arxiv.org/abs/1512.03385\">Source</a>.</span></li><li id=\"feed-note-2\">Figure 2: <span>Network architecture figure from He, Zhang, Ren, and Sun, “Deep Residual Learning for Image Recognition” (CVPR 2016). <a href=\"https://arxiv.org/abs/1512.03385\">Source</a>.</span></li><li id=\"feed-note-3\">Figure 3: <span>Residual learning block from He, Zhang, Ren, and Sun, “Deep Residual Learning for Image Recognition” (CVPR 2016). <a href=\"https://arxiv.org/abs/1512.03385\">Source</a>.</span></li></ol>",
      "date_published": "2022-01-26T00:00:00Z",
      "authors": [
        {
          "name": "Ramith Hettiarachchi",
          "url": "https://ramith.fyi"
        }
      ],
      "language": "en",
      "tags": [
        "scholarly"
      ]
    },
    {
      "id": "https://ramith.fyi/posts/2022-01-19-imagenet-classification-with-deep-convolutional-neural-networks/",
      "url": "https://ramith.fyi/posts/2022-01-19-imagenet-classification-with-deep-convolutional-neural-networks/",
      "title": "ImageNet classification with deep convolutional neural networks (AlexNet)",
      "content_html": "<h2>ImageNet classification with deep convolutional neural networks (AlexNet)</h2><div data-title=\"ImageNet classification with deep convolutional neural networks (AlexNet)\" data-slug=\"2022-01-19-imagenet-classification-with-deep-convolutional-neural-networks\" data-authors=\"Ramith Hettiarachchi\" data-date-published=\"2022-01-19\" data-language=\"en\" data-status=\"published\" data-license=\"CC-BY-4.0\" data-collections=\"scholarly\" data-doi=\"\"><p>By Ramith Hettiarachchi ⋅ Published <time datetime=\"2022-01-19\">2022-01-19</time></p></div><p>The AlexNet paper by Krizhevsky et al. <a href=\"#ref-alexnet\" role=\"doc-biblioref\">[1]</a> was published in 2012. It is a highly influential paper in computer vision which showed that deep networks, along with efficient utilization of GPUs for training, can help build better models. They achieved top-1 and top-5 test set error rates of 37.5% and 17.0%, compared with 47.1% and 28.2% for the previous best results in ILSVRC 2010. These are reductions of 9.6 and 11.2 percentage points, respectively.</p><h3>Introduction</h3><p>Before 2008, the computer vision researchers mostly evaluated their methods on datasets with <strong>tens of thousands of images.</strong> Thanks to the ImageNet dataset <a href=\"#ref-imagenet\" role=\"doc-biblioref\">[2]</a>, which was published in 2009, researchers got the opportunity to move from small scale datasets such as <em>MNIST, CIFAR-10/100</em> to a much larger dataset which has over <strong>15 million labeled images</strong> from more than 22,000 categories. The AlexNet paper evaluates their method for ILSVRC-2010 &amp; 2012 datasets.</p><p>The ImageNet Large-Scale Visual Recognition Challenge (ILSVRC) <a href=\"#ref-ilsvrc\" role=\"doc-biblioref\">[3]</a>, which started in 2010 <strong>focuses on a subset of ImageNet</strong> which has 1.2 million training images, 50,000 validation images, and 150,000 testing images.</p><h3>Architecture</h3><p>Key characteristics of the AlexNet architecture : 8 learned layers (5 Conv, 3 Fully-connected)<br>The architecture has 60 million parameters.</p><figure><p><sup><a href=\"#feed-note-1\">[Note 1]</a></sup></p><img src=\"https://ramith.fyi/feed-assets/447759c0d480c13b6b0fa3f782ef00cc5c65dc83c00def02e489026492732b35.png\"></figure><h4>1. ReLU nonlinearity</h4><p>Inspired by Nair and Hinton’s work <a href=\"#ref-relu\" role=\"doc-biblioref\">[4]</a>, authors have utilized the ReLU non-linearity and have found that it makes the training process several times faster.</p><figure><p><sup><a href=\"#feed-note-2\">[Note 2]</a></sup></p><img src=\"https://ramith.fyi/feed-assets/d8162e7a4b403acca34589ba9d5f9719e20f692dae97ca890690532960e06659.png\"></figure><h4>2. Multiple GPU Training</h4><p>Authors employ a cross-GPU parallelisation approach to train the AlexNet and the communication between GPUs happen only when it is required by the certain layers. They utilize 2x GTX 580 GPUs. Authors mention that this parallelism architecture is similar to “Columnar” CNN by Ciresan et al. <a href=\"#ref-multicolumn\" role=\"doc-biblioref\">[5]</a>.</p><figure><p><sup><a href=\"#feed-note-3\">[Note 3]</a></sup></p><img src=\"https://ramith.fyi/feed-assets/bd3bbdfac034c4e11175dd57b96c519a8a0b5419cf369625e7e7d9fd700c321e.png\"></figure><h4>3. Local Response Normalization</h4><p>Krizhevsky et al. has found that their local normalization methods helps achieve better generalization. For this procedure, they sum over <span role=\"math\"><img src=\"https://ramith.fyi/feed-assets/67bea37ea4704b501be7fe53d57c02ede9d6d9a19b6c327330e5ee8c5d0c3e3c.svg\" alt=\"Typeset mathematical expression\" width=\"8.8\" height=\"10.02\"></span> adjacent kernel maps at the same spatial location as shown in the equation below. This normalization has been applied in certain layers of AlexNet. <strong><span role=\"math\"><img src=\"https://ramith.fyi/feed-assets/7d9273b2d6fe06e5e66aa8d754f5e4e7ced443ddc47f1426127bceae8dc439d7.svg\" alt=\"Typeset mathematical expression\" width=\"13.33\" height=\"10.02\"></span></strong> = total number of kernels<br><strong><span role=\"math\"><img src=\"https://ramith.fyi/feed-assets/56cf8a01c1d9ccf6f87a1bacbd85cb02bc130a0e83b1cc4f21735d155d3f082c.svg\" alt=\"Typeset mathematical expression\" width=\"33.55\" height=\"10.13\"></span></strong> = response-normalized neuron activity</p><figure><p><sup><a href=\"#feed-note-4\">[Note 4]</a></sup></p><img src=\"https://ramith.fyi/feed-assets/d470eceeefb022d86e6f8d3ebf8b56c20c56c9ace04354d82c945658504b78de.png\"></figure><h4>4. Overlapping Pooling</h4><p>By overlapping pooling scheme has reduced top-1 and top-5 error rates by 0.4% and 0.3%. Furthermore, the authors have observed that models with overlapping pooling are slightly more difficult to overfit.</p><h3>Reducing Overfitting</h3><p>Authors have utilized <strong>1) data augmentations</strong> , <strong>2) dropout</strong> to reduce overfitting. Data augmentation has been done in two ways.</p><p><strong>1)</strong> Generating image translations and horizontal reflections</p><p><strong>2)</strong> Altering RGB channel intensities in training images</p><p>Authors cite their early work on dropout <a href=\"#ref-dropout\" role=\"doc-biblioref\">[6]</a> and mention that it has reduced overfitting substantially while roughly doubling the number of training iterations needed to converge.</p><section role=\"doc-bibliography\"><h2>References</h2><ol><li id=\"ref-alexnet\" data-paper-title=\"ImageNet Classification with Deep Convolutional Neural Networks\">Krizhevsky et al. (2012). <a href=\"https://proceedings.neurips.cc/paper/2012/hash/c399862d3b9d6b76c8436e924a68c45b-Abstract.html\">“ImageNet Classification with Deep Convolutional Neural Networks.”</a></li><li id=\"ref-imagenet\" data-paper-title=\"ImageNet: A Large-Scale Hierarchical Image Database\">Deng et al. (2009). <a href=\"https://image-net.org/static_files/papers/imagenet_cvpr09.pdf\">“ImageNet: A Large-Scale Hierarchical Image Database.”</a></li><li id=\"ref-ilsvrc\" data-paper-title=\"ImageNet Large Scale Visual Recognition Challenge\">Russakovsky et al. (2014). <a href=\"https://arxiv.org/abs/1409.0575\">“ImageNet Large Scale Visual Recognition Challenge.”</a></li><li id=\"ref-relu\" data-paper-title=\"Rectified Linear Units Improve Restricted Boltzmann Machines\">Nair and Hinton (2010). <a href=\"https://www.cs.toronto.edu/~hinton/absps/reluICML.pdf\">“Rectified Linear Units Improve Restricted Boltzmann Machines.”</a></li><li id=\"ref-multicolumn\" data-paper-title=\"Multi-column Deep Neural Networks for Image Classification\">Ciresan et al. (2012). <a href=\"https://arxiv.org/abs/1202.2745\">“Multi-column Deep Neural Networks for Image Classification.”</a></li><li id=\"ref-dropout\" data-paper-title=\"Improving neural networks by preventing co-adaptation of feature detectors\">Hinton et al. (2012). <a href=\"https://arxiv.org/abs/1207.0580\">“Improving neural networks by preventing co-adaptation of feature detectors.”</a></li></ol></section><footer>Unless otherwise noted, the original text of this post is licensed under the <a href=\"https://creativecommons.org/licenses/by/4.0/\">Creative Commons Attribution 4.0 International License</a>. Separately credited material may have different rights. <a href=\"https://ramith.fyi/license/\">Licensing details</a>.</footer><h2>Notes</h2><ol><li id=\"feed-note-1\">Figure 1: <span>AlexNet architecture figure from Krizhevsky, Sutskever, and Hinton, “ImageNet Classification with Deep Convolutional Neural Networks” (2012). <a href=\"https://proceedings.neurips.cc/paper/2012/hash/c399862d3b9d6b76c8436e924a68c45b-Abstract.html\">Source</a>.</span></li><li id=\"feed-note-2\">Figure 2: <span>ReLU training comparison from Krizhevsky, Sutskever, and Hinton, “ImageNet Classification with Deep Convolutional Neural Networks” (2012). <a href=\"https://proceedings.neurips.cc/paper/2012/hash/c399862d3b9d6b76c8436e924a68c45b-Abstract.html\">Source</a>.</span></li><li id=\"feed-note-3\">Figure 3: Just to get an idea on how GPUs now and then (2012) compare with each other. <span>GPU comparison from GadgetVersus; screenshot by Ramith Hettiarachchi.</span></li><li id=\"feed-note-4\">Figure 4: Local reponse normalization has reduced top-1 and top-5 error rates by 1.4% and 1.2%.<span>Illustration by Ramith Hettiarachchi, explaining local response normalization in Krizhevsky, Sutskever, and Hinton (2012).</span></li></ol>",
      "date_published": "2022-01-19T00:00:00Z",
      "authors": [
        {
          "name": "Ramith Hettiarachchi",
          "url": "https://ramith.fyi"
        }
      ],
      "language": "en",
      "tags": [
        "scholarly"
      ]
    },
    {
      "id": "https://ramith.fyi/posts/2022-01-05-jax-001-a-closer-look-at-its-background/",
      "url": "https://ramith.fyi/posts/2022-01-05-jax-001-a-closer-look-at-its-background/",
      "title": "JAX 001 - A closer look at its background",
      "content_html": "<h2>JAX 001 - A closer look at its background</h2><div data-title=\"JAX 001 - A closer look at its background\" data-slug=\"2022-01-05-jax-001-a-closer-look-at-its-background\" data-authors=\"Ramith Hettiarachchi\" data-date-published=\"2022-01-05\" data-language=\"en\" data-status=\"published\" data-license=\"CC-BY-4.0\" data-collections=\"scholarly\" data-doi=\"\"><p>By Ramith Hettiarachchi ⋅ Published <time datetime=\"2022-01-05\">2022-01-05</time></p></div><p>I recently wanted to get into parallel programming so that I can optimize one of the optics simulation projects I was working on (it was built without much focus on distributed training). So with all the buzz going around with JAX and some cool applications I found (listed below), I thought to give it a try.</p><ul><li>Protein Structure Prediction -<a href=\"https://github.com/deepmind/alphafold\">AlphaFold 2</a> <a href=\"#ref-alphafold\" role=\"doc-biblioref\">[1]</a></li><li>Differentiable, Hardware Accelerated, Molecular Dynamics -<a href=\"https://github.com/google/jax-md\">JAX-MD</a> <a href=\"#ref-jaxmd\" role=\"doc-biblioref\">[2]</a></li><li>Massively parallel rigid-body physics simulation -<a href=\"https://github.com/google/brax\">Brax</a> <a href=\"#ref-brax\" role=\"doc-biblioref\">[3]</a></li><li>Chemical Modelling -<a href=\"https://github.com/deepchem/jaxchem\">JAXChem</a> <a href=\"#ref-jaxchem\" role=\"doc-biblioref\">[4]</a></li><li>Computational Fluid Dynamics -<a href=\"https://github.com/google/jax-cfd\">JAX-CFD</a> <a href=\"#ref-jaxcfd\" role=\"doc-biblioref\">[5]</a></li><li>Differentiable Cosmology -<a href=\"https://github.com/DifferentiableUniverseInitiative/jax_cosmo\">JAX-Cosmo</a> <a href=\"#ref-jaxcosmo\" role=\"doc-biblioref\">[6]</a></li></ul><h3>Why JAX?</h3><p>With all the established libraries such as PyTorch and Tensorflow, why is there a requirement for this new library in the first place? Let’s find out.</p><p>We all know that increasing FLOPS (floating point operations per second) is a huge deal in machine learning to train models efficiently. JAX aims to help this goal by enabling researchers to write python programs which are automatically <strong>compiled</strong> and <strong>scaled</strong> to utilize accelerators (GPUs/TPUs). Often it is<a href=\"https://twitter.com/ChrSzegedy/status/1400704509240692743\">hard</a> to write optimized code in python to leverage the potential of hardware accelerators. JAX aims to keep a balance between research-friendly programming experience vs hardware acceleration.</p><p>To do so, JAX aims to accelerate <em>pure-and-statically-composed (PSC) subroutines</em>. It uses a <strong>just-in-time (JIT)</strong> compiler that traces these routines. To learn more about PSC subroutines, see the <a href=\"https://www.youtube.com/watch?v=iDxJxIyzSiM\"><em>NeurIPS 2020: JAX Ecosystem Meetup</em> video</a>. The compilation process monitors the program once; the name JAX was described as <em>“Just After eXecution”</em> in the <a href=\"https://cs.stanford.edu/~rfrostig/pubs/jax-mlsys2018.pdf\">JAX paper</a> <a href=\"#ref-resource1\" role=\"doc-biblioref\">[8]</a>.</p><h3>Key features of JAX</h3><p>JAX addresses several limitations in numpy. Therefore, it presents,</p><ul><li>Lightweight NumPy-like API for array-based computing</li><li>Composable function transformations<br></li></ul><p>(autodiff, JIT compilation, vectorization, parallelization)</p><ul><li>Execute on CPU, GPU, or TPU without changing your code.</li></ul><p>&gt; JAX is Autograd and XLA, brought together for high-performance numerical computing and machine learning research. It provides composable transformations of Python+NumPy programs: differentiate, vectorize, parallelize, Just-In-Time compile to GPU/TPU, and more.</p><figure><p><sup><a href=\"#feed-note-1\">[Note 1]</a></sup></p><img src=\"https://ramith.fyi/feed-assets/5bd72b3a3f200197caf0f27c9a0ae624717ecb38339ce9121694bf4ef058ef19.png\"></figure><h3>Getting familiar with related concepts and history</h3><p>There were a few loosly defined terms in my mind when I first read through the documentation. So I thought to look into those and have an idea about them.</p><p><em><strong>Autograd -</strong></em> Autograd is an example of an <em>automatic differentiation</em> library<a href=\"https://github.com/HIPS/autograd\">released in 2014</a> . It is a lightweight tool to automatically differentiate native python and numpy code. But it doesn’t focus on hardware accelerators such GPU/TPUs. Therefore, since 2018, the <strong>main developers of Autograd are focusing on JAX</strong> which has more functionalities. Dougal, one of the main authors of autograd,<a href=\"https://youtu.be/5XRphWnFkNM?t=376\">calls</a> JAX as the second generation of the project which started with Autograd.</p><p><strong><em>“XLA</em></strong> <strong>-</strong> <strong>(Accelerated Linear Algebra)</strong> is a compiler-based linear algebra execution engine. It is the backend that powers machine learning frameworks such as TensorFlow and JAX at Google, on a variety of devices including CPUs, GPUs, and TPUs.” - (to<a href=\"https://developers.googleblog.com/2017/03/xla-tensorflow-compiled.html\">read more</a> )</p><p><em><strong>JIT</strong> <strong>- (Just in time)</strong> compilation: This enables</em> compilation of a JAX Python function so it can be executed efficiently in XLA.</p><p>Digging into these concepts made me realize that while the libraries we use makes it really easy to build end-to-end differentiable models, under the hood, these tools have been years-long effort by amazing teams with cool design choices.</p><p>In the next writeup I’m going to share my experience with device parallelization (<code>pmap</code>) and automatic vectorization (<code>vmap</code>) aspects.</p><p>—</p><section role=\"doc-bibliography\"><h2>References</h2><ol><li id=\"ref-alphafold\" data-paper-title=\"Highly accurate protein structure prediction with AlphaFold\">Jumper et al. (2021). <a href=\"https://doi.org/10.1038/s41586-021-03819-2\">“Highly accurate protein structure prediction with AlphaFold.”</a></li><li id=\"ref-jaxmd\" data-paper-title=\"JAX MD: A Framework for Differentiable Physics\">Schoenholz and Cubuk (2020). <a href=\"https://papers.neurips.cc/paper_files/paper/2020/hash/83d3d4b6c9579515e1679aca8cbc8033-Abstract.html\">“JAX MD: A Framework for Differentiable Physics.”</a></li><li id=\"ref-brax\" data-paper-title=\"Brax -- A Differentiable Physics Engine for Large Scale Rigid Body Simulation\">Freeman et al. (2021). <a href=\"https://arxiv.org/abs/2106.13281\">“Brax -- A Differentiable Physics Engine for Large Scale Rigid Body Simulation.”</a></li><li id=\"ref-jaxchem\" data-paper-title=\"JAXChem: JAX-based chemical modeling software\">JAXChem contributors <a href=\"https://github.com/deepchem/jaxchem\">“JAXChem: JAX-based chemical modeling software.”</a></li><li id=\"ref-jaxcfd\" data-paper-title=\"Machine learning–accelerated computational fluid dynamics\">Kochkov et al. (2021). <a href=\"https://doi.org/10.1073/pnas.2101784118\">“Machine learning–accelerated computational fluid dynamics.”</a></li><li id=\"ref-jaxcosmo\" data-paper-title=\"JAX-Cosmo: A differentiable cosmology library in JAX\">JAX-Cosmo contributors <a href=\"https://github.com/DifferentiableUniverseInitiative/jax_cosmo\">“JAX-Cosmo: A differentiable cosmology library in JAX.”</a></li><li id=\"ref-resource0\" data-paper-title=\"JAX documentation\"><a href=\"https://jax.readthedocs.io/en/latest/index.html\">“JAX documentation.”</a></li><li id=\"ref-resource1\" data-paper-title=\"Compiling machine learning programs via high-level tracing\">Frostig, Johnson, and Leary (2018). <a href=\"https://cs.stanford.edu/~rfrostig/pubs/jax-mlsys2018.pdf\">“Compiling machine learning programs via high-level tracing.”</a></li><li id=\"ref-resource2\" data-paper-title=\"JAX: accelerated ML research — video\"><a href=\"https://youtu.be/mVf3HJ6gNDc\">“JAX: accelerated ML research — video.”</a></li><li id=\"ref-resource3\" data-paper-title=\"JAX: accelerated ML research — slides\"><a href=\"https://program-transformations.github.io/slides/NeurIPS_workshop_JAX_talk.pdf\">“JAX: accelerated ML research — slides.”</a></li><li id=\"ref-resource4\" data-paper-title=\"JAX at DeepMind — video\"><a href=\"https://www.youtube.com/watch?v=iDxJxIyzSiM\">“JAX at DeepMind — video.”</a></li><li id=\"ref-resource5\" data-paper-title=\"JAX at DeepMind — slides\"><a href=\"https://storage.googleapis.com/deepmind-media/Jax/NeurIPS%20outreach%20session.pdf\">“JAX at DeepMind — slides.”</a></li><li id=\"ref-resource6\" data-paper-title=\"Lecture 6: Automatic Differentiation\"><a href=\"https://www.cs.toronto.edu/~rgrosse/courses/csc421_2019/readings/L06%20Automatic%20Differentiation.pdf\">“Lecture 6: Automatic Differentiation.”</a></li><li id=\"ref-resource7\" data-paper-title=\"Cloud TPU Research Program\"><a href=\"https://sites.research.google/trc/about/\">“Cloud TPU Research Program.”</a></li></ol></section><footer>Unless otherwise noted, the original text of this post is licensed under the <a href=\"https://creativecommons.org/licenses/by/4.0/\">Creative Commons Attribution 4.0 International License</a>. Separately credited material may have different rights. <a href=\"https://ramith.fyi/license/\">Licensing details</a>.</footer><h2>Notes</h2><ol><li id=\"feed-note-1\">Figure 1: Full set of slides: <a href=\"#ref-resource3\" role=\"doc-biblioref\">[10]</a>.<span>Slide from the Google JAX team’s NeurIPS workshop presentation, “JAX: accelerated ML research”. <a href=\"https://program-transformations.github.io/slides/NeurIPS_workshop_JAX_talk.pdf\">Source</a>.</span></li></ol>",
      "date_published": "2022-01-05T00:00:00Z",
      "authors": [
        {
          "name": "Ramith Hettiarachchi",
          "url": "https://ramith.fyi"
        }
      ],
      "language": "en",
      "tags": [
        "scholarly"
      ]
    },
    {
      "id": "https://ramith.fyi/posts/2021-01-09-setting-up-raspberry-pi-4-with-ubuntu-20-04-ros-intel-realsense/",
      "url": "https://ramith.fyi/posts/2021-01-09-setting-up-raspberry-pi-4-with-ubuntu-20-04-ros-intel-realsense/",
      "title": "Getting the installation Right! Raspberry Pi 4 with Ubuntu 20.04 + ROS Noetic + Intel RealSense",
      "content_html": "<h2>Getting the installation Right! Raspberry Pi 4 with Ubuntu 20.04 + ROS Noetic + Intel RealSense</h2><div data-title=\"Getting the installation Right! Raspberry Pi 4 with Ubuntu 20.04 + ROS Noetic + Intel RealSense\" data-slug=\"2021-01-09-setting-up-raspberry-pi-4-with-ubuntu-20-04-ros-intel-realsense\" data-authors=\"Ramith Hettiarachchi\" data-date-published=\"2021-01-09\" data-language=\"en\" data-status=\"published\" data-license=\"CC-BY-4.0\" data-collections=\"scholarly\" data-doi=\"\"><p>By Ramith Hettiarachchi ⋅ Published <time datetime=\"2021-01-09\">2021-01-09</time></p></div><p><em>Historical guide: these steps describe my January 2021 setup with Ubuntu 20.04 and ROS Noetic.</em></p><p>Here I am after lot of iterations trying to install Ubuntu on Raspberry Pi 4(RPi4). Initially I made certain mistakes when selecting the correct ubuntu version &amp; Desktop.</p><p>The steps below are which I followed to finalize my Rpi Installation with Ubuntu.</p><h3>Ubuntu on RPi - Confusions?</h3><p>My goal was to have a <strong>stable ROS installation</strong> on <strong>ubuntu on RPI4</strong> . When considering the dependencies, I realized that RPI officially supports Ubuntu 20.04 &amp; 20.10. And as of now, the ROS version that matches with one of those ubuntu versions (Ubuntu 20.04) is ROS Noetic.</p><p>Now in ubuntu’s official download page (For RPi), they have listed the following versions. However, Ubuntu 20.04 Desktop version is not listed here. Therefore, the goal should be to install Ubuntu Server 20.04 and then install a desktop of our choice.</p><figure><p><sup><a href=\"#feed-note-1\">[Note 1]</a></sup></p><img src=\"https://ramith.fyi/feed-assets/80a7eae8421c19b0aaf04a94c9190eb785292206c7d5ade2ed851532e3987928.png\"></figure><h4>How this guide is organized</h4><ol><li>Installing Ubuntu Server 20.04.1<br></li></ol><ul><li>Setting up SD card (through RPi Imager)<br></li><li>Editing <strong>network-config</strong> file =&gt; connect to network</li></ul><ol><li>Installing the Desktop for Ubuntu Server</li><li>Trying out screen sharing<br></li></ol><ul><li>Connect remotely to view desktop</li></ul><ol><li>Installing ROS Noetic</li><li>Installing Realsense libraries for Ubuntu 20.04</li></ol><h4>1. Installing Ubuntu Server 20.04.1</h4><p>To install ubuntu server follow the official guide. When editing the file in microSD, double check whether you have edited it properly with correct wifi credentials</p><p><a href=\"https://ubuntu.com/tutorials/how-to-install-ubuntu-on-your-raspberry-pi#1-overview\"><a href=\"https://ubuntu.com/tutorials/how-to-install-ubuntu-on-your-raspberry-pi#1-overview\">https://ubuntu.com/tutorials/how-to-install-ubuntu-on-your-raspberry-pi#1-overview</a></a></p><h4>2. Installing the Desktop for Ubuntu Server</h4><p>This is a tricky part. After searching for “how to install desktop on Ubuntu Server”, I tried the command ❌ <code>sudo apt-get install ubuntu-desktop</code>, which led to many errors in the desktop environment, such as Wi-Fi connections not displaying.</p><p>Therefore, we will be using a tool called<a href=\"https://github.com/wimpysworld/desktopify\"><em><strong>Desktopify</strong></em></a> <em><strong>.</strong></em> After you have installed ubuntu server, follow these steps to install the Desktop</p><pre><code>git clone https://github.com/wimpysworld/desktopify.git\ncd desktopify\nsudo ./desktopify --de ubuntu</code></pre><p>This will take some time to install. This script will take care of all the dependencies you need, and will install a clean desktop environment</p><figure><p><sup><a href=\"#feed-note-2\">[Note 2]</a></sup></p><img src=\"https://ramith.fyi/feed-assets/a8b8d10db2a0c498a0bb11e7f7e3e1911773a1b85aedbbda6a544b8c977f0210.png\"></figure><h4>3. Trying out screensharing</h4><p>Please follow the guide<a href=\"https://ubuntuhandbook.org/index.php/2020/07/remote-desktop-sharing-ubuntu-20-04/\">here</a> to enable screensharing so that you can view the RPi’s desktop remotely from your Laptop.</p><p><strong>NOTE: To connect from your computer you will first need a monitor which is plugged to the RPI4.</strong> <em>If you want to <strong>access the screen remotely even when a monitor is not attached</strong> , Check the <strong>very end</strong> of this post.</em></p><figure><p><sup><a href=\"#feed-note-3\">[Note 3]</a></sup></p><img src=\"https://ramith.fyi/feed-assets/f35e7d51b7182acb701c145280f4485022183b48b5835c82655f4f21fd2b62b4.png\"></figure><h4>4. Installing ROS Noetic</h4><p>You can follow these steps, to install ROS Noetic</p><p><a href=\"http://wiki.ros.org/noetic/Installation/Ubuntu\"><a href=\"http://wiki.ros.org/noetic/Installation/Ubuntu\">http://wiki.ros.org/noetic/Installation/Ubuntu</a></a></p><h4>5. Installing Realsense libraries</h4><p>My friend Shalutha suggested these steps to install the required dependencies of Realsense.</p><p><a href=\"https://answers.ros.org/question/363889/intel-realsens-on-ubuntu-2004-ros-noetic-installation-desription/\">RealSense installation instructions on ROS Answers</a>.</p><p>You can copy paste these steps to an .sh file and execute it</p><pre><code>nano realsense.sh\n#copy paste the steps listed in the link to this file\nchmod +x realsense.sh\n./realsense.sh</code></pre><figure><p><sup><a href=\"#feed-note-4\">[Note 4]</a></sup></p><img src=\"https://ramith.fyi/feed-assets/15df4c5f540744805124c8e56f24072eff45b142df49943d61c84b0e277c4704.png\"></figure><h4>Congratulations 🥳</h4><p>Now you have a stable ubuntu desktop 20.04 installation!</p><pre><code>/opt/realsense/bin/realsense-viewer</code></pre><figure><p><sup><a href=\"#feed-note-5\">[Note 5]</a></sup></p><img src=\"https://ramith.fyi/feed-assets/5766b0ff2050cfcc8e538a15b298498fef145f62a43253b625a1e6faeea4e56e.png\"></figure><h3>Extras</h3><h4>1. Logging in with an SSH key</h4><p>Follow the <a href=\"https://www.atlantic.net/vps-hosting/how-to-set-up-ssh-keys-on-ubuntu-18-04/\">SSH key setup tutorial</a> linked in the original guide.</p><h4>2. Accessing remote screen when a monitor is not attached.</h4><pre><code>sudo apt-get install xserver-xorg-video-dummy</code></pre><pre><code>sudo nano /etc/X11/xorg.conf\n</code></pre><p>Copy the following configuration into that file:</p><pre><code>Section &quot;Device&quot;\n    Identifier &quot;Configured Video Device&quot;\n    Driver &quot;dummy&quot;\nEndSection\n\nSection &quot;Monitor&quot;\n    Identifier &quot;Configured Monitor&quot;\n    HorizSync 31.5-48.5\n    VertRefresh 50-70\nEndSection\n\nSection &quot;Screen&quot;\n    Identifier &quot;Default Screen&quot;\n    Monitor &quot;Configured Monitor&quot;\n    Device &quot;Configured Video Device&quot;\n    DefaultDepth 24\n    SubSection &quot;Display&quot;\n        Depth 24\n        Modes &quot;1024x800&quot;\n    EndSubSection\nEndSection</code></pre><p>Now reboot the RPi<code>sudo reboot</code>. Then you can connect from your laptop even if there is no monitor attached to the RPi.</p><p>(source:<a href=\"https://askubuntu.com/questions/453109/add-fake-display-when-no-monitor-is-plugged-in\"><a href=\"https://askubuntu.com/questions/453109/add-fake-display-when-no-monitor-is-plugged-in\">https://askubuntu.com/questions/453109/add-fake-display-when-no-monitor-is-plugged-in</a></a> )</p><h3>Final outcome of setting up 🎉</h3><div><p><a href=\"https://www.youtube.com/watch?v=CgjEviTkvpA\">Watch the original setup demo on YouTube.</a></p></div><footer>Unless otherwise noted, the original text of this post is licensed under the <a href=\"https://creativecommons.org/licenses/by/4.0/\">Creative Commons Attribution 4.0 International License</a>. Separately credited material may have different rights. <a href=\"https://ramith.fyi/license/\">Licensing details</a>.</footer><h2>Notes</h2><ol><li id=\"feed-note-1\">Figure 1: source: <a href=\"https://ubuntu.com/download/raspberry-pi\">https://ubuntu.com/download/raspberry-pi</a><span>Ubuntu Raspberry Pi download page by Canonical; screenshot by Ramith Hettiarachchi. <a href=\"https://ubuntu.com/download/raspberry-pi\">Source</a>.</span></li><li id=\"feed-note-2\">Figure 2: After Desktopifying Ubuntu Server 20.04.1<span>Ubuntu desktop running on my Raspberry Pi. Screenshot by Ramith Hettiarachchi.</span></li><li id=\"feed-note-3\">Figure 3: <span>Raspberry Pi setup screenshot by Ramith Hettiarachchi.</span></li><li id=\"feed-note-4\">Figure 4: (It will take some time to install)<span>Installation on my Raspberry Pi. Screenshot by Ramith Hettiarachchi.</span></li><li id=\"feed-note-5\">Figure 5: (Screenshot taken from the plugged monitor)<span>Intel RealSense running on my Raspberry Pi. Screenshot by Ramith Hettiarachchi.</span></li></ol>",
      "date_published": "2021-01-09T00:00:00Z",
      "authors": [
        {
          "name": "Ramith Hettiarachchi",
          "url": "https://ramith.fyi"
        }
      ],
      "language": "en",
      "tags": [
        "scholarly"
      ]
    }
  ]
}
