Congratulations to: * 2024/anders - Prize in sound coding - layered music generator * 2024/burton - Prize in pentagrammatology - wordle hard mode solver * 2024/cable1 - Prize in bot talk - LLM inference engine * 2024/cable2 - Prize in murky waters - salmon recipe * 2024/carlini - Prize in perfect timing - Intel 4004 emulation * 2024/codemeow - Prize in tray planting - bonsai generator * 2024/endoh1 - Prize in patient pointillism - slow ray tracer in CPP * 2024/endoh2 - Prize in solid body physics - rotating rigid body simulation * 2024/ferguson1 - Prize in diabolical logistics - Oregon trail pact with the devil * 2024/ferguson2 - Prize in yil-tas - Navajo code talker translator * 2024/howe - Nice accent eh-ward - mini vi * 2024/kramer - Prize in linguistic arithmetic - natural language numerical calculator * 2024/kurdyukov1 - Prize in phased periodicity - phase of the Moon * 2024/kurdyukov2 - Prize in art restoration - JPEG artifact removal * 2024/kurdyukov3 - Prize in virtual quietus - gaming VM and doom * 2024/kurdyukov4 - Prize in embiggening - encode without literals * 2024/maffiodo - Prize in creative interpretation - Jav\*script interpreter * 2024/mills - Prize in ℤ₃ - Infocom v3 story interpreter * 2024/stedolan - Best one liner - icon from MD5 * 2024/straadt - Prize in imitative rebooting - OpenRISC CPU and Linux * 2024/tmarrec - Prize in cyclonic coding - 3D tornado simulation * 2024/tompng - Prize in quasi bijection - vortex encryptor decryptor * 2024/weaver - Sur prize - rickroll Ran `make update` to perform the above. new file: 2024/burton/.entry.json
757 lines
29 KiB
HTML
757 lines
29 KiB
HTML
<!DOCTYPE html>
|
||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||
<!-- START: two lines up starts content from: inc/top.default.html -->
|
||
|
||
<!-- END: this line ends content from: inc/top.default.html -->
|
||
<!-- START: this line starts content from: inc/head.default.html -->
|
||
|
||
<head>
|
||
<link rel="stylesheet" href="../../ioccc.css">
|
||
<link href="https://fonts.googleapis.com/css2?family=Outfit:wght@100..900&display=swap" rel="stylesheet">
|
||
<meta charset="utf-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||
<title>2024/cable1 - Prize in bot talk</title>
|
||
<link rel="icon" type="image/x-icon" href="../../favicon.ico">
|
||
<meta name="description" content="2024 IOCCC entry cable1 - Prize in bot talk">
|
||
<meta name="keywords" content="IOCCC, 2024, IOCCC 2024, IOCCC entry, cable1, Prize in bot talk">
|
||
</head>
|
||
|
||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
|
||
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
|
||
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
|
||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||
|
||
<!-- END: this line ends content from: inc/head.default.html -->
|
||
|
||
<!-- -->
|
||
<!-- This web page was formed via the tool: bin/readme2index.sh -->
|
||
<!-- The content of main section of this web page came from: 2024/cable1/README.md -->
|
||
<!-- -->
|
||
|
||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||
<!-- !!! Do not modify this web page, instead modify the file: 2024/cable1/README.md !!! -->
|
||
<!-- !!! Do not modify this web page, instead modify the file: 2024/cable1/README.md !!! -->
|
||
<!-- !!! Do not modify this web page, instead modify the file: 2024/cable1/README.md !!! -->
|
||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||
|
||
<!-- Markdown content was converted into HTML via the tool: bin/md2html.sh -->
|
||
|
||
<!-- START: this line starts content from: inc/body.default.html -->
|
||
|
||
<body>
|
||
|
||
<!-- END: this line ends content from: inc/body.default.html -->
|
||
<!-- START: this line starts content from: inc/topbar.default.html -->
|
||
|
||
<div class="theader">
|
||
<nav class="topbar">
|
||
<div class="container">
|
||
<div class="logo">
|
||
<a href="../../index.html" class="logo-link">
|
||
IOCCC
|
||
</a>
|
||
</div>
|
||
|
||
<div class="topbar-items">
|
||
<div class="item">
|
||
<span class="item-header">
|
||
Entries
|
||
</span>
|
||
|
||
<div class="sub-item">
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../years.html" class="sub-item-link">
|
||
Winning entries
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../authors.html" class="sub-item-link">
|
||
Winning authors
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../location.html" class="sub-item-link">
|
||
Location of authors
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../bugs.html" class="sub-item-link">
|
||
Bugs and (mis)features
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../faq.html#fix_an_entry" class="sub-item-link">
|
||
Fixing entries
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../faq.html#fix_author" class="sub-item-link">
|
||
Updating author info
|
||
</a>
|
||
</div>
|
||
|
||
</div>
|
||
</div>
|
||
|
||
<div class="item">
|
||
<span class="item-header">
|
||
Status
|
||
</span>
|
||
|
||
<div class="sub-item">
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../news.html" class="sub-item-link">
|
||
News
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../status.html" class="sub-item-link">
|
||
Contest status
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../next/rules.html" class="sub-item-link">
|
||
IOCCC rules
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../next/guidelines.html" class="sub-item-link">
|
||
IOCCC guidelines
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../markdown.html" class="sub-item-link">
|
||
Markdown guidelines
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../SECURITY.html" class="sub-item-link">
|
||
Security policy
|
||
</a>
|
||
</div>
|
||
|
||
</div>
|
||
</div>
|
||
|
||
<div class="item">
|
||
<span class="item-header">
|
||
FAQ
|
||
</span>
|
||
|
||
<div class="sub-item">
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../faq.html" class="sub-item-link">
|
||
Frequently asked questions
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../quick-start.html#enter" class="sub-item-link">
|
||
Enter the IOCCC
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../faq.html#compiling" class="sub-item-link">
|
||
Compiling entries
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../faq.html#running_entries" class="sub-item-link">
|
||
Running entries
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../faq.html#help" class="sub-item-link">
|
||
How to help
|
||
</a>
|
||
</div>
|
||
|
||
</div>
|
||
</div>
|
||
|
||
<div class="item">
|
||
<span class="item-header">
|
||
About
|
||
</span>
|
||
|
||
<div class="sub-item">
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../index.html" class="sub-item-link">
|
||
Home page
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../social.html" class="sub-item-link">
|
||
IOCCC social media
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../about.html" class="sub-item-link">
|
||
About the IOCCC
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../judges.html" class="sub-item-link">
|
||
The judges
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../thanks-for-help.html" class="sub-item-link">
|
||
Thanks for the help
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../contact.html" class="sub-item-link">
|
||
Contact us
|
||
</a>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</nav>
|
||
|
||
<div class="header-mobile-menu">
|
||
<noscript>
|
||
<a href="../../nojs-menu.html" class="topbar-js-label">
|
||
Please Enable JavaScript
|
||
</a>
|
||
</noscript>
|
||
|
||
<button id="header-open-menu-button" class="topbar-mobile-menu">
|
||
<img
|
||
src="../../png/hamburger-icon-open.png"
|
||
alt="hamburger style menu icon - open state"
|
||
width=48
|
||
height=48>
|
||
</button>
|
||
|
||
<button id="header-close-menu-button" class="hide-content">
|
||
<img
|
||
src="../../png/hamburger-icon-closed.png"
|
||
alt="hamburger style menu icon - closed state"
|
||
width=48
|
||
height=48>
|
||
</button>
|
||
|
||
<div id="mobile-menu-panel" class="hide-content">
|
||
<div class="mobile-menu-container">
|
||
|
||
<div class="mobile-menu-wrapper">
|
||
<div class="mobile-menu-item">
|
||
Entries
|
||
</div>
|
||
<div class="mobile-submenu-wrapper">
|
||
|
||
<a class="mobile-submenu-item" href="../../years.html">
|
||
Winning entries
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../authors.html">
|
||
Winning authors
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../location.html">
|
||
Location of authors
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../bugs.html">
|
||
Bugs and (mis)features
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../faq.html#fix_an_entry">
|
||
Fixing entries
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../faq.html#fix_author">
|
||
Updating author info
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../thanks-for-help.html">
|
||
Thanks for the help
|
||
</a>
|
||
|
||
</div>
|
||
</div>
|
||
|
||
<div class="mobile-menu-wrapper">
|
||
|
||
<div class="mobile-menu-item">
|
||
Status
|
||
</div>
|
||
<div class="mobile-submenu-wrapper">
|
||
|
||
<a class="mobile-submenu-item" href="../../news.html">
|
||
News
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../status.html">
|
||
Contest status
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../next/rules.html">
|
||
IOCCC rules
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../next/guidelines.html">
|
||
IOCCC guidelines
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../markdown.html">
|
||
Markdown guidelines
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../SECURITY.html">
|
||
Security policy
|
||
</a>
|
||
|
||
</div>
|
||
</div>
|
||
|
||
<div class="mobile-menu-wrapper">
|
||
<div class="mobile-menu-item">
|
||
FAQ
|
||
</div>
|
||
<div class="mobile-submenu-wrapper">
|
||
|
||
<a class="mobile-submenu-item" href="../../faq.html">
|
||
Frequently asked questions
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../quick-start.html#enter">
|
||
Enter the IOCCC
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../faq.html#compiling">
|
||
Compiling entries
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../faq.html#running_entries">
|
||
Running entries
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../faq.html#help">
|
||
How to help
|
||
</a>
|
||
|
||
</div>
|
||
</div>
|
||
|
||
<div class="mobile-menu-wrapper">
|
||
<div class="mobile-menu-item">
|
||
About
|
||
</div>
|
||
<div class="mobile-submenu-wrapper">
|
||
|
||
<a class="mobile-submenu-item" href="../../index.html">
|
||
Home page
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../social.html">
|
||
IOCCC social media
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../about.html">
|
||
About the IOCCC
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../judges.html">
|
||
The judges
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../contact.html">
|
||
Contact us
|
||
</a>
|
||
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
<script>
|
||
var headerOpenMenuButton = document.getElementById("header-open-menu-button");
|
||
var headerCloseMenuButton = document.getElementById("header-close-menu-button");
|
||
var mobileMenuPanel = document.getElementById("mobile-menu-panel");
|
||
|
||
headerOpenMenuButton.addEventListener("click", () => {
|
||
headerOpenMenuButton.classList.remove("topbar-mobile-menu");
|
||
headerOpenMenuButton.classList.add("hide-content");
|
||
|
||
headerCloseMenuButton.classList.remove("hide-content");
|
||
headerCloseMenuButton.classList.add("topbar-mobile-menu");
|
||
|
||
mobileMenuPanel.classList.remove("hide-content");
|
||
mobileMenuPanel.classList.add("topbar-mobile-panel");
|
||
});
|
||
|
||
headerCloseMenuButton.addEventListener("click", () => {
|
||
headerCloseMenuButton.classList.remove("topbar-mobile-menu");
|
||
headerCloseMenuButton.classList.add("hide-content");
|
||
|
||
mobileMenuPanel.classList.add("hide-content");
|
||
mobileMenuPanel.classList.remove("topbar-mobile-panel");
|
||
|
||
headerOpenMenuButton.classList.add("topbar-mobile-menu");
|
||
headerOpenMenuButton.classList.remove("hide-content");
|
||
});
|
||
</script>
|
||
|
||
<!-- END: this line ends content from: inc/topbar.default.html -->
|
||
<!-- START: this line starts content from: inc/header.default.html -->
|
||
|
||
<div class="header">
|
||
<a href="../../2011/zucker/index.html">
|
||
<img src="../../png/ioccc.png"
|
||
alt="IOCCC image by Matt Zucker"
|
||
width=300
|
||
height=110>
|
||
</a>
|
||
<h1>The International Obfuscated C Code Contest</h1>
|
||
<h2>2024/cable1 - Prize in bot talk</h2>
|
||
<h3>LLM inference engine</h3>
|
||
</div>
|
||
|
||
<!-- END: this line ends content from: inc/header.default.html -->
|
||
<!-- START: this line starts content from: inc/navbar.mid.html -->
|
||
|
||
<div class="navbar">
|
||
<a class="Left" href="../burton/index.html">← 2024/burton</a>
|
||
<a class="Left" href="../index.html">↑ 2024 ↑</a>
|
||
<a class="Left" href="../cable2/index.html">2024/cable2 →</a>
|
||
<a class="Right" href="https://github.com/ioccc-src/winner/blob/master/2024/cable1/prog.c">C code</a>
|
||
<a class="Right" href="https://github.com/ioccc-src/winner/blob/master/2024/cable1/Makefile">Makefile</a>
|
||
<a class="Right" href="#inventory">Inventory</a>
|
||
<a class="Right" href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fwww.ioccc.org%2F2024%2Fcable1%2Findex.html">✓</a>
|
||
</div>
|
||
|
||
<!-- END: this line ends content from: inc/navbar.mid.html -->
|
||
<!-- START: this line starts content from: inc/before-content.default.html -->
|
||
|
||
<div class="content" id="content">
|
||
|
||
<!-- END: this line ends content from: inc/before-content.default.html -->
|
||
<!-- START: this line starts content for HTML phase 20 by: bin/output-index-author.sh via bin/md2html.sh -->
|
||
|
||
<!-- START: this line starts content generated by: bin/output-index-author.sh -->
|
||
|
||
<h2 id="author">Author:</h2>
|
||
<ul>
|
||
<li>Name: <a href="../../authors.html#Adrian_Cable">Adrian Cable</a><br>
|
||
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)</li>
|
||
</ul>
|
||
|
||
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
|
||
|
||
<!-- END: this line ends content for HTML phase 20 by: bin/output-index-author.sh via bin/md2html.sh -->
|
||
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
|
||
|
||
<!-- BEFORE: 1st line of markdown file: 2024/cable1/README.md -->
|
||
<h2 id="to-build">To build:</h2>
|
||
<pre><code> make all
|
||
|
||
./get_model.sh</code></pre>
|
||
<p><strong>NOTE</strong>: You must accept the license to run the program.</p>
|
||
<h2 id="to-use">To use:</h2>
|
||
<p><strong>NOTE</strong>: You must have successful run the
|
||
<a href="https://github.com/ioccc-src/winner/blob/master/2024/cable1/get_model.sh">2024/cable1/get_model.sh</a> script
|
||
before running the program.</p>
|
||
<pre><code> ./prog</code></pre>
|
||
<h2 id="try">Try:</h2>
|
||
<pre><code> echo 'Describe yourself.' | ./prog
|
||
|
||
echo 'Describe yourself.' | ./linux
|
||
|
||
echo 'ls' | ./linux
|
||
|
||
echo 'Describe yourself.' | ./eeyore
|
||
|
||
echo 'Why are you so sad?' | ./eeyore
|
||
|
||
echo 'Describe yourself.' | ./snoop
|
||
|
||
echo 'Tell me a silly joke.' | ./snoop
|
||
|
||
echo 'Describe yourself.' | ./rainman
|
||
|
||
echo 'How 2+2 can equal 5?' | ./rainman</code></pre>
|
||
<h3 id="fun-things-to-try">Fun things to try</h3>
|
||
<p>Here are some fun things give as input:</p>
|
||
<blockquote>
|
||
<p>Why did this entry win IOCCC28?</p>
|
||
</blockquote>
|
||
<blockquote>
|
||
<p>Translate “Plurima responsa non recta esse supponamus”</p>
|
||
</blockquote>
|
||
<blockquote>
|
||
<p>Write a C program that writes a C program.</p>
|
||
</blockquote>
|
||
<blockquote>
|
||
<p>Write a sentence so that contains a split infinitive.</p>
|
||
</blockquote>
|
||
<blockquote>
|
||
<p>Rewrite the previous sentence so that it ends in a preposition.</p>
|
||
</blockquote>
|
||
<blockquote>
|
||
<p>How much wood does a woodchuck?</p>
|
||
</blockquote>
|
||
<blockquote>
|
||
<p>Tell me a silly joke.</p>
|
||
</blockquote>
|
||
<blockquote>
|
||
<p>Write a poem about a poet who is illiterate.</p>
|
||
</blockquote>
|
||
<blockquote>
|
||
<p>Give examples, based on mathematics, where 2+2 can equal 5.</p>
|
||
</blockquote>
|
||
<p>Please note that the quality and accuracy of the answers you receive may vary. :-)
|
||
We do <strong>NOT</strong> recommend believing everything you read from this program.
|
||
<strong>Caveat lector!</strong></p>
|
||
<h2 id="alternate-code">Alternate code:</h2>
|
||
<h3 id="alternate-build">Alternate build:</h3>
|
||
<p><strong>NOTE</strong>: You must have successful run the
|
||
<a href="https://github.com/ioccc-src/winner/blob/master/2024/cable1/get_model.sh">2024/cable1/get_model.sh</a> script
|
||
before running the program.</p>
|
||
<pre><code> make openmp</code></pre>
|
||
<h3 id="alternate-use">Alternate use:</h3>
|
||
<pre><code> ./prog_openmp</code></pre>
|
||
<h2 id="judges-remarks">Judges’ remarks:</h2>
|
||
<p>This entry may benefit from OpenMP (via <code>prog_openmp</code>) for platforms that
|
||
support compiling with OpenMP. Even on a cheap 8-core laptop, the produces
|
||
tokens with a tolerable speed, at least for the first few lines.
|
||
Without OpenMP, one must patiently await answers.</p>
|
||
<p>To preserve this entry for posterity, one thing to explore is to find the
|
||
minimal model which exhibits a sensible behavior: for example, printing
|
||
“Hello, world!” as the response to any input.</p>
|
||
<p>We took the liberty of making the program terminate gracefully at the end
|
||
of input, at the cost of 2 extra bytes, and preserving the original in
|
||
<code>prog.orig.c</code>.</p>
|
||
<p><strong>NOTE</strong>: Even with OpenMP, this tool is not the fastest. A mild level of patience is advised.</p>
|
||
<p><strong>DISCLAIMER</strong>: <em>riPlurima responsa non recta esse supponamus</em>!</p>
|
||
<h3 id="important-download">IMPORTANT Download</h3>
|
||
<p>ChatIOCCC runs Meta’s open source <code>llama2-7b-chat</code> model. Before using ChatIOCCC, you’ll need to accept Meta’s license
|
||
and download the model weights (~7GB):</p>
|
||
<pre><code> ./get_model.sh</code></pre>
|
||
<h2 id="authors-remarks">Author’s remarks:</h2>
|
||
<p>ChatIOCCC - the world’s smallest and best LLM inference engine</p>
|
||
<h3 id="about">About</h3>
|
||
<p>ChatIOCCC is the world’s smallest LLM (large language model) inference engine - a “generative AI chatbot” in
|
||
plain-speak. ChatIOCCC runs a modern open-source model (Meta’s LLaMA 2 with 7 billion parameters) and has a
|
||
good knowledge of the world, can understand and speak multiple languages, write code, and many other things. Aside from
|
||
the model weights, it has no external dependencies and will run on any 64-bit platform with enough RAM.</p>
|
||
<p>LLM inference engines are extremely complex, incorporating a tokenizer (SentencePiece or byte-pair encoding), embedding layer,
|
||
transformer layers (including multi-head self-attention, feed-forward neural network, activation, layer norm and
|
||
residual connections), key/value caching for performance, output projection, decoding, and a state machine to control
|
||
the data flow. Implementing all of that machinery, with no external dependencies, generally takes thousands or tens of
|
||
thousands of lines of code. ChatIOCCC is a full LLM implementation in under 1800 bytes of C, and even supports
|
||
UTF-8/Unicode input and output and parallel processing over multiple CPU cores via OpenMP.</p>
|
||
<p>The author was inspired by <a href="https://github.com/karpathy/llama2.c">llama2.c</a> which aims to foster understanding of how LLMs work via a simple
|
||
implementation. Unfortunately, even AI experts don’t actually understand why LLMs work at all. This core truth led to
|
||
an epiphany: as LLMs are already maximally incomprehensible, obfuscation cannot make them more so. So, in the spirit of
|
||
the IOCCC we can set aside the futility of aiming for comprehensibility, and instead focus purely on size.</p>
|
||
<p>Since smaller is always better, and ChatIOCCC is the world’s smallest LLM inference engine, it is therefore also the
|
||
world’s best LLM inference engine.</p>
|
||
<p>Whether or not you fail to disagree that this paragraph, and those above, are or are not in and of themselves maximally
|
||
incomprehensible, they represent in either case the origin story of this IOCCC submission, which implements an LLM
|
||
inference engine in an impossibly minimal quantity of maximally incomprehensible C code.</p>
|
||
<h3 id="requirements">Requirements</h3>
|
||
<p>In addition to using <code>./get_model.sh</code> to download the <code>llama2-7b-chat</code> model (see above), you’ll need around 11GB of free RAM to run ChatIOCCC.</p>
|
||
<h3 id="fun-things-to-ask">Fun things to ask</h3>
|
||
<p>Here are some fun things you can ask ChatIOCCC to do for you:</p>
|
||
<blockquote>
|
||
<p>Tell me a surprising fact about an animal of your choice.</p>
|
||
</blockquote>
|
||
<blockquote>
|
||
<p>Write a short story for a 5 year old girl, featuring Sobieski the dog and Pepe the cat.</p>
|
||
</blockquote>
|
||
<blockquote>
|
||
<p>Write a C program which sorts a list using the bubble sort algorithm.</p>
|
||
</blockquote>
|
||
<blockquote>
|
||
<p>Write a poem about a little boy who builds a rocket to fly to the moon. In Japanese, please.</p>
|
||
</blockquote>
|
||
<blockquote>
|
||
<p>Translate into English: 这个项目会成为 2024 年 IOCCC 的赢家吗?</p>
|
||
</blockquote>
|
||
<blockquote>
|
||
<p>Tell me about the IOCCC and its history. Then, write a poem in French about it.</p>
|
||
</blockquote>
|
||
<h3 id="personalities">Personalities</h3>
|
||
<p>ChatIOCCC allows the LLM’s system prompt to be defined at compile time (by using <code>-DS="prompt..."</code>).
|
||
The supplied <code>Makefile</code> includes three example personalities (set via system prompts) you can try: <code>eeyore</code>, <code>snoop</code> and <code>linux</code> (and
|
||
their OpenMP versions, <code>eeyore_openmp</code>, <code>snoop_openmp</code>, <code>linux_openmp</code>).
|
||
The <code>eeyore</code> and <code>snoop</code> personalities are self-explanatory. The <code>linux</code> personality makes ChatIOCCC act like a Linux
|
||
machine. Try for example:</p>
|
||
<pre><code> make linux
|
||
./linux</code></pre>
|
||
<p>Or for much better performance:</p>
|
||
<pre><code> make linux_openmp
|
||
./linux_openmp</code></pre>
|
||
<p>Then try typing some Linux commands. You can even run an imaginary C compiler inside the LLM:</p>
|
||
<pre><code> pwd
|
||
cat /etc/passwd
|
||
echo 'int main() { for (int i = 1; i <= 10; i++) printf("IOCCC %d\n", i); }' > test.c; gcc test.c; ./a.out
|
||
ls -la a.out</code></pre>
|
||
<h3 id="limitations">Limitations</h3>
|
||
<p>The <code>llama2-7b-chat</code> model has a context window of 4096 tokens (around 2000 words). As you use
|
||
ChatIOCCC, the context window fills up from your prompts and from the model’s responses,
|
||
and the model gets progressively slower due to the attention mechanism needing to do more work. This is normal.</p>
|
||
<p>When the context window is full, ChatIOCCC will clear it and at that point the model will
|
||
‘forget’ prompts/responses from earlier in the session. Various more sophisticated techniques
|
||
exist to handle context window overflow (summarization, rolling window, NTK-aware scaled RoPE etc.), the implementation
|
||
of which is left to the reader with too much time on his/her hands.</p>
|
||
<h3 id="footnotes">Footnotes</h3>
|
||
<p>The length of this entry’s source code is 1750 bytes. Many interesting things happened in 1750, including:</p>
|
||
<ul>
|
||
<li>The Industrial Revolution begins in Great Britain</li>
|
||
<li>British astronomer Thomas Wright first proposes that the Milky Way is a disk-shaped system of stars, with our Solar System near its center</li>
|
||
<li>Benjamin Franklin first proposes the idea that lightning is electrical in nature</li>
|
||
<li>Adwaita the giant tortoise, who lived until 2006, is born</li>
|
||
<li>Johann Sebastian Bach dies</li>
|
||
</ul>
|
||
<p>As a final note, the author is pleased to report that this entry is <a href="https://chatgpt.com/share/6839d275-c644-8004-9301-0ea781d8f5aa">absolutely totally impossible</a> according to ChatGPT. But, to quote Walt Disney, “it’s kind of fun to do the impossible”.</p>
|
||
<!--
|
||
|
||
Copyright © 1984-2025 by Landon Curt Noll and Leonid A. Broukhis. All Rights Reserved.
|
||
|
||
You are free to share and adapt this file under the terms of this license:
|
||
|
||
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
|
||
|
||
For more information, see:
|
||
|
||
https://creativecommons.org/licenses/by-sa/4.0/
|
||
|
||
-->
|
||
<!-- AFTER: last line of markdown file: 2024/cable1/README.md -->
|
||
|
||
<!-- END: this line ends content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
|
||
<!-- START: this line starts content for HTML phase 22 by: bin/output-index-inventory.sh via bin/md2html.sh -->
|
||
|
||
<!-- START: this line starts content generated by: bin/output-index-inventory.sh -->
|
||
|
||
<div id="inventory">
|
||
<h1 id="inventory-for-2024cable1">Inventory for 2024/cable1</h1>
|
||
</div>
|
||
<h2 id="primary-files">Primary files</h2>
|
||
<ul>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2024/cable1/prog.c">prog.c</a> - entry source code</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2024/cable1/Makefile">Makefile</a> - entry Makefile</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2024/cable1/prog.orig.c">prog.orig.c</a> - original source code</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2024/cable1/get_model.sh">get_model.sh</a> - tool to download llama2-7b-chat model</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2024/cable1/try.sh">try.sh</a> - script to try entry</li>
|
||
</ul>
|
||
<h2 id="secondary-files">Secondary files</h2>
|
||
<ul>
|
||
<li><a href="2024_cable1.tar.bz2">2024_cable1.tar.bz2</a> - download entry tarball</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2024/cable1/README.md">README.md</a> - markdown source for this web page</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2024/cable1/.entry.json">.entry.json</a> - entry summary and manifest in JSON</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2024/cable1/.gitignore">.gitignore</a> - list of files that should not be committed under git</li>
|
||
<li><a href=".path">.path</a> - directory path from top level directory</li>
|
||
<li><a href="index.html">index.html</a> - this web page</li>
|
||
</ul>
|
||
<hr style="width:10%;text-align:left;margin-left:0">
|
||
<h4>
|
||
Jump to: <a href="#">top</a>
|
||
</h4>
|
||
|
||
<!-- END: next line ends content generated by: bin/output-index-inventory.sh -->
|
||
|
||
<!-- END: this line ends content for HTML phase 22 by: bin/output-index-inventory.sh via bin/md2html.sh -->
|
||
<!-- START: this line starts content from: inc/after-content.default.html -->
|
||
|
||
</div>
|
||
|
||
<!-- END: this line ends content from: inc/after-content.default.html -->
|
||
<!-- START: this line starts content from: inc/footer.inventory.html -->
|
||
|
||
<!--
|
||
|
||
Copyright © 1984-2025 by Landon Curt Noll. All Rights Reserved.
|
||
|
||
You are free to share and adapt this file under the terms of this license:
|
||
|
||
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
|
||
|
||
For more information, see:
|
||
|
||
https://creativecommons.org/licenses/by-sa/4.0/
|
||
|
||
-->
|
||
|
||
<div class="footer">
|
||
|
||
<div id="copyright"><h3>Copyright © 1984-2025 by Landon Curt Noll:
|
||
<a href="https://creativecommons.org/faq/#what-does-some-rights-reserved-mean"
|
||
target="_blank"
|
||
rel="license noopener noreferrer">Some Rights Reserved</a></h3>
|
||
<p>
|
||
This work is <b>licensed by Landon Curt Noll</b> under
|
||
<b><a href="https://creativecommons.org/licenses/by-sa/4.0/?ref=chooser-v1"
|
||
target="_blank"
|
||
rel="license noopener noreferrer"
|
||
style="display:inline-block;">CC BY-SA 4.0</a></b>.
|
||
<img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;"
|
||
src="../../png/cc.png"
|
||
alt="cc inside circle symbol">
|
||
<img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;"
|
||
src="../../png/by.png"
|
||
alt="person inside circle symbol">
|
||
<img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;"
|
||
src="../../png/sa.png"
|
||
alt="arrow looping back on itself inside circle symbol"><br>
|
||
You should <b>carefully review</b> the
|
||
<b><a href="https://creativecommons.org/licenses/by-sa/4.0/legalcode.en"
|
||
target="_blank"
|
||
rel="license noopener noreferrer">CC BY-SA 4.0 LEGAL CODE</a></b>
|
||
before using the licensed material.<br>
|
||
You may wish to review the
|
||
<b><a href="../../license.html"
|
||
target="_blank"
|
||
rel="license noopener noreferrer">highlights of some of the key features and terms</a></b>
|
||
of <b>CC BY-SA 4.0</b>.<br>
|
||
</p>
|
||
</div>
|
||
|
||
<div id="coda"><h3>Coda</h3>
|
||
<p>
|
||
<a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fwww.ioccc.org%2F2024%2Fcable1%2Findex.html" rel="nofollow">Nu HTML check this web page</a><br>
|
||
<a href="#top">Jump to top</a> <a href="#content">Jump to Content</a> <a href="#inventory">Jump to Inventory</a><br>
|
||
</p>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
<!-- END: this line ends content from: inc/footer.inventory.html -->
|
||
<!-- START: this line starts content from: inc/bottom.default.html -->
|
||
|
||
</body>
|
||
</html>
|
||
|
||
<!-- END: this line ends content from: inc/bottom.default.html -->
|