CINXE.COM

The New World of LLM Functions: Integrating LLM Technology into the Wolfram Language—Stephen Wolfram Writings

<!DOCTYPE html> <html lang="en" prefix="fb: http://www.facebook.com/2008/fbml, og: http://ogp.me/ns#"> <head> <!-- begin framework head en --> <meta http-equiv="x-ua-compatible" content="ie=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta charset="utf-8"> <title>The New World of LLM Functions: Integrating LLM Technology into the Wolfram Language&mdash;Stephen Wolfram Writings</title> <meta name="description" content="How to install and use Wolfram's instant LLM-powered functions. Stephen Wolfram shares dozens of examples and explains how the functions work. Also download "pre-written" prompts from a curated repository."> <meta property="og:image" content="https://content.wolfram.com/sites/43/2023/05/blog-hero-nestlist-llm-function.png"> <meta property="og:url" content="https://writings.stephenwolfram.com/2023/05/the-new-world-of-llm-functions-integrating-llm-technology-into-the-wolfram-language/"> <meta property="og:type" content="website"> <meta property="og:title" content="The New World of LLM Functions: Integrating LLM Technology into the Wolfram Language"> <meta property="og:description" content="How to install and use Wolfram's instant LLM-powered functions. Stephen Wolfram shares dozens of examples and explains how the functions work. Also download "pre-written" prompts from a curated repository."> <meta name="twitter:title" content="The New World of LLM Functions: Integrating LLM Technology into the Wolfram Language"> <meta name="twitter:description" content="How to install and use Wolfram's instant LLM-powered functions. Stephen Wolfram shares dozens of examples and explains how the functions work. Also download "pre-written" prompts from a curated repository."> <meta name="twitter:image:src" content="https://content.wolfram.com/sites/43/2023/05/blog-hero-nestlist-llm-function.png"> <link rel="stylesheet" href="/common/framework/css/framework.en.css"> <script src="//www.wolframcdn.com/consent/cookie-consent.js"></script> <script src="/common/javascript/wal/latest/walLoad.js"></script> <script defer src="/common/js/announcements/script.js"></script> <script src="/common/framework/js/head.en.js"></script> <script src="/common/js/jquery/3.7.1/jquery.min.js"></script> <script src="/common/js/jquery/plugins/migrate/3.5.2/jquery.migrate.min.js"></script> <script src="/common/javascript/analytics.js"></script> <!-- end framework head en --> <script src="https://writings.stephenwolfram.com/wp-content/themes/sw-writings/jquery.lazy.min.js"></script> <script> $(function() { $('.lazy').Lazy({ effect: 'fadeIn', effectTime: 250, threshold:200 }); }); </script> <script type="text/javascript" src="https://writings.stephenwolfram.com/wp-content/themes/sw-writings/sw.js"></script> <link rel="stylesheet" href="//www.wolframcdn.com/fonts/source-sans-pro/1.0/global.css"> <link rel="stylesheet" href="//www.wolframcdn.com/fonts/hack/3.003/global.css"> <link rel="stylesheet" href="//www.wolframcdn.com/fonts/mathematica/1.0/all.css"> <link rel="stylesheet" href="https://writings.stephenwolfram.com/wp-content/themes/sw-writings/clipboard.css" type="text/css" media="all" /> <link rel="stylesheet" href="https://writings.stephenwolfram.com/wp-content/themes/sw-writings/python-pygments.css" type="text/css" media="all" /> <link rel="stylesheet" href="/common/js/clipboard/2.0/clipboard.css"> <link rel="stylesheet" href="/common/templates/www.stephenwolfram.com/css/responsive-header.css" /> <link rel="stylesheet" href="https://writings.stephenwolfram.com/wp-content/themes/sw-writings/style.css" type="text/css" media="all" /> <link rel="alternate" type="application/rss+xml" title="Stephen Wolfram Writings RSS Feed" href="https://writings.stephenwolfram.com/feed/" /> <link rel="alternate" type="application/atom+xml" title="Stephen Wolfram Writings Atom Feed" href="https://writings.stephenwolfram.com/feed/atom/" /> <script type="text/javascript" src="https://files.wolframcdn.com/pub/writings.stephenwolfram.com/js/menu.js?5db8f077951d5e4ef6fbad86daf24214146552f3ae141ac21f7cf2aef767799678b244ec4070f219c19860ab58d8271a"></script> <link rel="stylesheet" href="/common/javascript/jquery/ui/1.10.2/themes/base/jquery.ui.all.css"> <link rel="stylesheet" href="/common/javascript/jquery/plugins/colorbox/colorbox.css"> <script src="/common/javascript/jquery/ui/1.10.2/ui/jquery.ui.core.js"></script> <script src="/common/javascript/jquery/ui/1.10.2/ui/jquery.ui.widget.js"></script> <script src="/common/javascript/jquery/ui/1.10.2/ui/jquery.ui.mouse.js"></script> <script src="/common/javascript/jquery/ui/1.10.2/ui/jquery.ui.slider.js"></script> <script src="/common/javascript/jquery/plugins/colorbox/jquery.colorbox.js"></script> <link rel="stylesheet" href="/common/javascript/jquery/plugins/magnific/magnific.css"> <link rel="stylesheet" href="/common/javascript/jquery/plugins/magnific/magnific-types.css"> <script src="/common/javascript/jquery/plugins/magnific/magnific.min.js"></script> <script src="/common/javascript/jquery/plugins/magnific/magnific-types.js"></script> <link rel='dns-prefetch' href='//s.w.org' /> <link rel="alternate" type="application/rss+xml" title="Stephen Wolfram Writings &raquo; The New World of LLM Functions: Integrating LLM Technology into the Wolfram Language Comments Feed" href="https://writings.stephenwolfram.com/2023/05/the-new-world-of-llm-functions-integrating-llm-technology-into-the-wolfram-language/feed/" /> <script type="text/javascript"> window._wpemojiSettings = {"baseUrl":"https:\/\/s.w.org\/images\/core\/emoji\/2.2.1\/72x72\/","ext":".png","svgUrl":"https:\/\/s.w.org\/images\/core\/emoji\/2.2.1\/svg\/","svgExt":".svg","source":{"concatemoji":"https:\/\/writings.stephenwolfram.com\/wp-includes\/js\/wp-emoji-release.min.js?ver=4.7.2"}}; !function(a,b,c){function d(a){var b,c,d,e,f=String.fromCharCode;if(!k||!k.fillText)return!1;switch(k.clearRect(0,0,j.width,j.height),k.textBaseline="top",k.font="600 32px Arial",a){case"flag":return k.fillText(f(55356,56826,55356,56819),0,0),!(j.toDataURL().length<3e3)&&(k.clearRect(0,0,j.width,j.height),k.fillText(f(55356,57331,65039,8205,55356,57096),0,0),b=j.toDataURL(),k.clearRect(0,0,j.width,j.height),k.fillText(f(55356,57331,55356,57096),0,0),c=j.toDataURL(),b!==c);case"emoji4":return k.fillText(f(55357,56425,55356,57341,8205,55357,56507),0,0),d=j.toDataURL(),k.clearRect(0,0,j.width,j.height),k.fillText(f(55357,56425,55356,57341,55357,56507),0,0),e=j.toDataURL(),d!==e}return!1}function e(a){var c=b.createElement("script");c.src=a,c.defer=c.type="text/javascript",b.getElementsByTagName("head")[0].appendChild(c)}var f,g,h,i,j=b.createElement("canvas"),k=j.getContext&&j.getContext("2d");for(i=Array("flag","emoji4"),c.supports={everything:!0,everythingExceptFlag:!0},h=0;h<i.length;h++)c.supports[i[h]]=d(i[h]),c.supports.everything=c.supports.everything&&c.supports[i[h]],"flag"!==i[h]&&(c.supports.everythingExceptFlag=c.supports.everythingExceptFlag&&c.supports[i[h]]);c.supports.everythingExceptFlag=c.supports.everythingExceptFlag&&!c.supports.flag,c.DOMReady=!1,c.readyCallback=function(){c.DOMReady=!0},c.supports.everything||(g=function(){c.readyCallback()},b.addEventListener?(b.addEventListener("DOMContentLoaded",g,!1),a.addEventListener("load",g,!1)):(a.attachEvent("onload",g),b.attachEvent("onreadystatechange",function(){"complete"===b.readyState&&c.readyCallback()})),f=c.source||{},f.concatemoji?e(f.concatemoji):f.wpemoji&&f.twemoji&&(e(f.twemoji),e(f.wpemoji)))}(window,document,window._wpemojiSettings); </script> <style type="text/css"> img.wp-smiley, img.emoji { display: inline !important; border: none !important; box-shadow: none !important; height: 1em !important; width: 1em !important; margin: 0 .07em !important; vertical-align: -0.1em !important; background: none !important; padding: 0 !important; } </style> <link rel='stylesheet' id='howToCiteCss-css' href='https://writings.stephenwolfram.com/wp-content/themes/sw-writings/HowToCite/style.css?ver=4.7.2' type='text/css' media='all' /> <script type='text/javascript' src='https://writings.stephenwolfram.com/wp-content/themes/sw-writings/HowToCite/HowToCite.js?ver=4.7.2'></script> <link rel='https://api.w.org/' href='https://writings.stephenwolfram.com/wp-json/' /> <link rel="wlwmanifest" type="application/wlwmanifest+xml" href="https://writings.stephenwolfram.com/wp-includes/wlwmanifest.xml" /> <link rel='prev' title='Instant Plugins for ChatGPT: Introducing the Wolfram ChatGPT Plugin Kit' href='https://writings.stephenwolfram.com/2023/04/instant-plugins-for-chatgpt-introducing-the-wolfram-chatgpt-plugin-kit/' /> <link rel='next' title='Prompts for Work &#038; Play: Launching the Wolfram Prompt Repository' href='https://writings.stephenwolfram.com/2023/06/prompts-for-work-play-launching-the-wolfram-prompt-repository/' /> <link rel='shortlink' href='https://writings.stephenwolfram.com/?p=49776' /> <link rel="alternate" type="application/json+oembed" href="https://writings.stephenwolfram.com/wp-json/oembed/1.0/embed?url=https%3A%2F%2Fwritings.stephenwolfram.com%2F2023%2F05%2Fthe-new-world-of-llm-functions-integrating-llm-technology-into-the-wolfram-language%2F" /> <link rel="alternate" type="text/xml+oembed" href="https://writings.stephenwolfram.com/wp-json/oembed/1.0/embed?url=https%3A%2F%2Fwritings.stephenwolfram.com%2F2023%2F05%2Fthe-new-world-of-llm-functions-integrating-llm-technology-into-the-wolfram-language%2F&#038;format=xml" /> <link rel='canonical' href='https://writings.stephenwolfram.com/2023/05/the-new-world-of-llm-functions-integrating-llm-technology-into-the-wolfram-language/'/> <style type="text/css">.recentcomments a{display:inline !important;padding:0 !important;margin:0 !important;}</style> </head> <body id="blog" class="post-template-default single single-post postid-49776 single-format-standard"> <a name="top"></a> <div id="wrapper"> <header id="header"> <div class="inner"> <button class="hamburger">&equiv;</button> <h1 id="logo"> <a href="https://www.stephenwolfram.com">Stephen Wolfram <svg viewBox="6.252 51.944 1031.673 96.468"> <g id="logoSVG"> <path d="M643.657,60.162c1.429-0.357,2.501-0.714,3.572-0.714h0.536V53.91h-34.121v5.538h0.536 c4.287,0.357,7.503,1.072,9.468,1.965c1.787,0.894,2.68,1.965,2.68,3.216c0,1.072-0.179,2.322-0.357,3.751 s-0.893,4.288-1.965,8.218c-1.429,5.716-3.395,12.505-5.538,20.544c-2.144,7.682-4.645,16.436-7.503,26.439L588.456,55.16h-6.968 l-22.33,66.812c-4.823-16.971-8.218-29.297-10.719-37.693c-2.501-8.575-4.287-15.006-5.181-18.758c0-0.357-0.179-1.072-0.357-1.786 c-0.179-0.715-0.179-1.251-0.179-1.608c0-1.072,1.607-1.608,3.037-1.965c2.322-0.536,5.002-0.714,8.218-0.893h0.536V53.91h-38.23 v5.538h0.536c1.071,0,2.322,0.357,3.751,0.714c1.43,0.357,2.502,0.894,3.573,1.608c1.251,0.893,2.144,1.787,2.858,2.68 s1.251,2.144,1.607,3.394c1.608,5.538,4.646,16.257,9.111,32.514c4.466,16.078,8.933,31.799,13.22,46.805l0.179,0.357h6.432 l23.581-69.314l22.509,68.957l0.179,0.357h6.61l0.178-0.357c4.646-14.827,9.111-29.119,13.041-42.339 c4.109-13.22,7.504-24.832,10.54-34.657c0.715-2.144,1.43-3.751,2.323-5.002c0.893-1.25,2.144-2.144,3.572-3.215 C640.978,61.234,642.406,60.698,643.657,60.162z" /> <path d="M693.856,87.673c-2.858-3.037-6.253-5.359-10.183-6.967c-3.931-1.608-8.039-2.501-12.506-2.501 c-4.287,0-8.396,0.893-12.147,2.501c-3.931,1.607-7.324,3.93-10.183,6.967c-2.858,3.037-5.359,6.789-6.968,11.076 c-1.607,4.288-2.501,9.111-2.501,14.47c0,4.823,0.894,9.647,2.322,13.935c1.608,4.287,3.752,8.039,6.61,11.076 s6.253,5.537,10.004,7.324c3.931,1.786,8.218,2.68,12.862,2.68c4.288,0,8.396-0.894,12.327-2.502 c3.751-1.607,7.146-3.93,10.183-6.967s5.359-6.788,6.967-11.076c1.608-4.287,2.501-9.11,2.501-14.291s-0.893-10.004-2.501-14.292 C699.037,94.462,696.715,90.71,693.856,87.673z M690.998,113.041c0,4.287-0.357,8.218-1.251,11.791 c-0.714,3.395-1.965,6.609-3.751,9.289l0,0c-1.608,2.68-3.752,4.823-6.253,6.252c-2.501,1.43-5.538,2.323-8.575,2.323 c-3.394,0-6.431-0.715-8.753-2.144c-2.501-1.43-4.467-3.573-6.074-6.253s-2.858-5.896-3.752-9.29 c-0.714-3.572-1.25-7.502-1.25-11.969c0-3.93,0.357-7.86,1.071-11.434c0.715-3.572,1.787-6.788,3.395-9.289 c1.608-2.68,3.573-5.002,6.074-6.61s5.538-2.501,9.11-2.501c3.216,0,6.074,0.714,8.575,2.144s4.466,3.395,6.253,5.896 c1.607,2.68,2.858,5.716,3.751,9.468C690.641,104.467,690.998,108.754,690.998,113.041z" /> <path d="M760.49,126.082c-0.714,1.787-1.786,4.109-3.394,6.967c-1.608,2.859-3.037,5.002-4.288,6.432 c-0.356,0.357-0.893,0.715-1.786,1.072s-1.786,0.535-2.858,0.715c-1.071,0.178-2.322,0.356-3.395,0.356 c-1.25,0-2.322,0.179-3.572,0.179c-2.501,0-4.466,0-5.896-0.179c-1.25-0.179-2.322-0.536-2.858-0.894 c-0.715-0.535-1.071-1.25-1.25-2.322c-0.179-1.071-0.357-2.68-0.357-4.645V89.46c0-0.893,0.179-1.787,0.535-2.68 c0.357-0.714,0.894-1.25,1.787-1.608c0.536-0.179,1.607-0.536,2.858-0.714c1.25-0.357,2.501-0.357,3.216-0.536h0.535v-4.287 h-28.583v4.287h0.536c0.715,0,1.786,0.179,3.037,0.536c1.25,0.357,2.144,0.714,2.858,1.072c0.893,0.357,1.607,1.072,1.786,1.608 c0.357,0.714,0.536,1.608,0.536,2.501v46.983c0,1.071-0.179,1.966-0.536,2.68c-0.357,0.715-0.894,1.251-1.786,1.608 c-0.536,0.178-1.43,0.357-2.858,0.535c-1.43,0.179-2.501,0.179-3.216,0.357h-0.536v4.287h51.986l1.429-20.543h-4.108 L760.49,126.082z" /> <path d="M768.708,83.922h0.536c0.715,0,1.965,0.179,3.216,0.536c1.429,0.357,2.501,0.714,3.216,1.072 c0.893,0.357,1.607,1.072,1.786,1.608c0.357,0.714,0.536,1.608,0.536,2.501v47.341c0,1.071-0.179,1.965-0.536,2.68 c-0.357,0.714-0.894,1.251-1.786,1.608c-0.357,0.178-1.072,0.356-2.858,0.535c-1.608,0.179-2.68,0.179-3.752,0.357h-0.536v4.287 h29.298v-4.287h-0.536c-0.714,0-1.965-0.179-3.394-0.536c-1.787-0.356-2.68-0.536-2.858-0.714 c-0.894-0.357-1.608-1.072-1.965-1.787c-0.357-0.715-0.536-1.607-0.536-2.501v-22.151h6.967c1.965,0,3.573,0.178,5.002,0.535 c1.251,0.357,2.322,1.072,3.216,2.145c0.536,0.714,1.072,1.965,1.607,3.572c0.536,1.607,0.894,3.216,0.894,4.467v0.535h4.466 V98.928h-4.466v0.357c-0.179,1.607-0.536,3.037-0.894,4.466c-0.535,1.429-1.071,2.322-1.607,3.037 c-0.894,0.893-1.786,1.607-3.037,2.143c-1.25,0.537-2.858,0.715-5.181,0.715h-6.967V84.458h10.54c1.607,0,3.037,0,4.466,0.179 c1.251,0,2.501,0.179,3.395,0.357c1.786,0.179,3.572,1.787,5.538,4.466c1.965,2.68,3.394,5.359,3.93,7.682l0.179,0.357h4.288V80.17 h-52.165V83.922L768.708,83.922z" /> <path d="M952.534,141.624c-1.072-0.356-1.966-0.536-2.68-1.071c-1.072-0.715-1.787-1.43-2.323-2.145 c-0.535-0.715-1.071-1.607-1.429-2.857l-21.795-56.452l-0.179-0.357h-4.287l-0.179,0.357c-3.037,8.039-6.609,17.15-10.54,27.333 c-3.93,10.182-7.503,19.472-10.897,27.689c-0.714,1.607-1.25,2.858-1.965,3.572c-0.715,0.895-1.607,1.787-2.68,2.502 c-0.715,0.535-1.607,0.893-2.858,1.072c-0.536,0.178-1.071,0.178-1.607,0.356c-0.357,0-0.715-0.179-1.251-0.179 c-1.071-0.178-2.144-0.535-2.858-0.893c-1.071-0.536-2.144-1.251-3.215-2.145c-1.072-0.893-2.323-2.144-3.573-3.93 c-3.037-4.109-5.717-7.682-7.86-10.719c-1.965-2.858-4.645-6.252-7.682-10.183c2.144-0.715,4.108-1.429,5.896-2.322 c1.965-1.072,3.751-2.144,5.002-3.573c1.607-1.43,2.68-3.215,3.572-5.181c0.715-1.965,1.251-4.288,1.251-6.789 c0-2.858-0.536-5.359-1.787-7.503c-1.25-1.965-2.68-3.751-4.645-5.002s-4.287-2.144-6.788-2.858 c-2.501-0.536-5.181-0.893-7.86-0.893H826.59v4.287h0.535c0.894,0,1.965,0.179,3.037,0.357c1.251,0.179,2.144,0.536,2.858,0.715 c1.072,0.357,1.607,0.893,1.965,1.607c0.357,0.715,0.357,1.608,0.357,2.68v47.341c0,1.072-0.179,1.965-0.536,2.68 c-0.356,0.715-0.893,1.25-1.786,1.607c-0.536,0.18-1.429,0.357-2.858,0.537c-1.429,0.178-2.501,0.178-3.216,0.356h-0.535v4.288 h28.583v-4.288h-0.536c-0.894,0-2.144-0.179-3.395-0.356c-1.25-0.18-2.322-0.357-2.858-0.537c-0.893-0.357-1.607-0.893-1.965-1.607 s-0.536-1.607-0.536-2.68v-19.83h5.896c3.573,4.646,6.967,9.29,10.004,13.578c3.037,4.466,6.61,9.825,10.54,15.898l0.179,0.18 h14.471h3.93h21.616v-4.288h-0.536c-2.322-0.179-4.466-0.536-6.431-1.251c-1.786-0.535-2.501-1.429-2.501-2.322 c0-0.535,0-1.071,0.179-1.965c0.179-0.893,0.356-1.965,0.893-3.215c0.357-1.43,0.894-2.859,1.43-4.467 c0.536-1.43,1.25-3.215,1.965-5.359h22.331l5.359,14.291c0.178,0.357,0.178,0.537,0.178,0.895c0,0.356,0,0.714,0,0.893 c0,0.357-0.714,0.893-1.965,1.25c-1.607,0.537-3.572,0.715-5.895,0.894h-0.536v4.288h28.94v-4.288h-0.536 C954.499,141.981,953.605,141.803,952.534,141.624z M928.238,118.579h-18.222l9.11-23.581L928.238,118.579z M866.069,96.963 c0,4.467-1.429,8.039-4.108,10.719s-6.253,3.93-10.183,3.93h-5.538V84.637h7.324c3.931,0,7.146,1.072,9.29,3.394 C864.998,90.175,866.069,93.211,866.069,96.963z" /> <path d="M1037.211,141.981c-0.714,0-1.965-0.179-3.215-0.357c-1.43-0.179-2.322-0.536-2.858-0.894 c-0.894-0.535-1.608-1.071-1.965-1.786c-0.357-0.714-0.536-1.429-0.536-2.501V89.281c0-0.893,0.179-1.786,0.536-2.68 c0.356-0.714,0.893-1.25,1.786-1.608c0.536-0.178,1.607-0.357,2.858-0.714c1.25-0.179,2.322-0.357,3.216-0.357h0.535v-4.287h-22.33 v0.536c0,0.357-0.179,1.25-0.715,3.216c-0.357,1.607-0.894,3.215-1.429,4.645l-15.542,40.016L979.33,79.992l-0.178-0.357h-23.046 v4.287h0.536c1.25,0,2.68,0.357,3.93,0.715c1.251,0.357,2.502,0.893,3.395,1.786c0.715,0.715,1.43,1.608,1.787,2.858 s0.714,2.68,0.714,4.645v33.585c0,4.108-0.179,7.146-0.536,8.932c-0.356,1.607-1.071,2.858-1.965,3.752 c-0.715,0.715-1.965,1.072-3.394,1.429c-1.43,0.357-2.858,0.536-4.288,0.715h-0.357v4.288h27.333v-4.288h-0.536 c-0.357,0-1.429-0.179-4.108-0.894c-1.966-0.535-3.395-1.072-3.931-1.786c-0.893-0.715-1.607-2.144-1.965-3.931 c-0.536-1.965-0.715-4.822-0.715-8.574v-38.23l21.08,56.452h3.037l22.152-55.559v46.805c0,1.071-0.179,1.966-0.536,2.68 c-0.357,0.715-1.072,1.251-1.965,1.786c-0.536,0.357-1.608,0.536-3.216,0.715s-3.037,0.357-3.93,0.357h-0.536v4.287h29.833v-4.287 L1037.211,141.981z" /> <path d="M64.133,103.572L64.133,103.572c-1.786-1.965-3.93-3.572-6.252-5.001s-4.823-2.68-7.503-3.751 c-2.858-1.25-5.717-2.501-8.754-3.573c-3.037-1.072-6.074-2.323-9.111-3.93c-3.394-1.608-6.074-3.752-7.86-6.253 c-1.786-2.501-2.68-5.716-2.68-9.468c0-3.573,1.429-6.789,4.109-9.29c2.68-2.501,6.074-3.751,10.004-3.751 c3.751,0,6.967,0.714,9.468,2.144c2.501,1.429,4.824,3.394,6.61,5.895c1.787,2.501,3.395,5.359,4.466,8.575 c1.25,3.215,2.144,6.431,3.216,10.004l0.178,0.357h6.074l-0.536-31.62h-5.895l-2.501,4.288c-2.68-1.608-5.538-3.037-8.754-4.288 c-3.394-1.25-7.146-1.965-11.433-1.965c-3.751,0-7.324,0.715-10.719,1.965c-3.394,1.25-6.431,3.037-8.932,5.359 c-2.68,2.322-4.824,5.002-6.252,8.039c-1.429,3.037-2.144,6.431-2.144,10.004c0,6.074,1.429,11.255,4.288,15.006 s6.967,6.967,12.148,9.289c2.68,1.251,5.716,2.502,9.29,3.752c3.573,1.25,6.789,2.501,9.646,3.752 c3.93,1.607,6.967,3.93,8.933,6.967c1.965,3.037,3.037,6.432,3.037,10.004c0,2.501-0.357,4.645-0.893,6.432 c-0.714,1.786-1.608,3.395-2.858,4.823s-3.037,2.501-5.181,3.216s-4.645,1.071-7.503,1.071c-3.93,0-7.325-0.714-10.183-2.144 c-2.858-1.43-5.538-3.395-7.682-5.896c-2.322-2.679-4.287-5.538-5.538-8.575c-1.608-3.215-2.858-6.788-3.931-10.539l-0.178-0.357 H6.252l0.894,32.334h5.895l2.68-4.466c2.858,1.786,6.252,3.216,10.183,4.466c4.109,1.251,8.218,1.965,12.327,1.965 c8.932,0,16.435-2.68,22.509-8.039c6.074-5.358,9.111-12.146,9.111-20.365c0-3.395-0.536-6.431-1.429-9.11 S66.099,105.717,64.133,103.572z" /> <path d="M81.462,96.784h4.288l0.179-0.357c0.357-1.072,0.714-2.323,1.429-3.93c0.714-1.608,1.607-3.037,2.501-4.466 c0.893-1.429,1.965-2.68,3.037-3.751c1.072-1.072,1.965-1.608,3.037-1.787c1.25-0.179,2.68-0.179,4.109-0.357 c1.429,0,2.68,0,3.751,0h2.323v54.308c0,1.25-0.179,2.145-0.715,2.858c-0.357,0.715-1.072,1.251-2.144,1.608 c-0.715,0.357-1.965,0.535-3.752,0.714c-1.786,0.179-3.215,0.357-4.108,0.357H94.86v4.288h33.049v-4.288h-0.536 c-0.893,0-2.322-0.179-4.109-0.536c-1.786-0.357-3.037-0.715-3.573-0.893c-1.072-0.357-1.787-1.072-2.144-1.787 c-0.357-0.715-0.536-1.786-0.536-2.68v-53.95h2.322c1.25,0,2.68,0,4.109,0.178c1.429,0,2.68,0.179,3.752,0.357 c0.893,0.179,1.965,0.715,3.037,1.787s2.144,2.322,3.037,3.751s1.787,2.858,2.501,4.466c0.714,1.607,1.25,2.858,1.608,3.93 l0.179,0.357h4.108V77.312H81.462V96.784z" /> <path d="M200.439,125.725c-0.357,1.43-1.429,3.752-3.037,6.789s-3.037,5.359-4.466,6.788 c-0.536,0.536-1.25,0.894-2.501,1.251c-1.251,0.357-2.501,0.535-3.752,0.715c-1.072,0.178-2.68,0.178-4.287,0.178h-4.109 c-2.68,0-4.645,0-6.074-0.178c-1.429-0.18-2.322-0.537-3.215-1.072c-0.715-0.536-1.25-1.251-1.429-2.322 c-0.357-1.072-0.357-2.68-0.357-4.645v-20.188h7.146c1.965,0,3.573,0.179,4.823,0.536c1.072,0.356,2.144,1.071,3.216,2.322 c0.536,0.714,1.072,1.965,1.607,3.573c0.536,1.607,0.894,3.215,1.072,4.823v0.536h4.466V96.963h-4.466v0.357 c-0.179,1.25-0.536,2.858-0.894,4.287c-0.536,1.43-1.072,2.68-1.786,3.573c-0.715,1.071-1.787,1.786-2.858,2.144 s-2.858,0.715-5.181,0.715h-7.146V82.136h10.183c1.787,0,3.216,0,4.645,0.178c1.429,0,2.501,0.179,3.573,0.357 c1.787,0.179,3.751,1.608,5.717,4.288c2.144,2.68,3.394,5.181,4.109,7.503l0.179,0.357h4.466V77.491H146.31v4.288h0.536 c0.893,0,1.965,0.179,3.394,0.536c1.429,0.357,2.501,0.715,3.395,1.072c1.072,0.536,1.607,1.072,1.965,1.786 c0.357,0.715,0.536,1.608,0.536,2.68v48.949c0,1.072-0.179,1.965-0.536,2.68s-1.072,1.25-1.965,1.607 c-0.357,0.18-1.072,0.357-3.037,0.536c-1.608,0.179-2.858,0.357-3.751,0.357h-0.536v4.288h57.167l1.429-21.08h-4.288 L200.439,125.725z" /> <path d="M258.499,81.957c-3.93-3.037-9.29-4.645-15.721-4.645h-31.441V81.6h0.536c0.894,0,1.787,0.179,3.037,0.357 c1.072,0.179,2.322,0.536,3.573,0.893c1.072,0.357,1.608,0.893,1.965,1.787c0.357,0.893,0.536,1.786,0.536,2.858v49.127 c0,1.071-0.179,2.144-0.536,2.858c-0.357,0.715-0.894,1.25-1.787,1.607c-0.536,0.18-1.429,0.357-2.858,0.536 s-2.501,0.357-3.394,0.357h-0.536v4.288h30.012v-4.288h-0.536c-1.25,0-2.501-0.179-3.93-0.357s-2.322-0.356-2.858-0.536 c-1.072-0.357-1.608-0.893-1.965-1.607c-0.357-0.715-0.536-1.787-0.536-2.68v-20.365h7.146c3.216,0,6.432-0.357,9.29-1.251 c2.858-0.894,5.717-2.144,8.218-3.93s4.466-4.108,5.896-6.968c1.429-2.857,2.144-6.074,2.144-9.646 C264.573,89.46,262.608,85.172,258.499,81.957z M251.353,101.25c-0.357,1.608-1.072,3.037-2.144,4.646l0,0 c-1.072,1.429-2.68,2.858-4.645,3.751c-2.144,1.072-4.823,1.608-8.217,1.608h-4.466V82.314h6.252c2.68,0,4.824,0.357,6.61,1.25 c1.787,0.715,3.216,1.965,4.288,3.395s1.787,2.858,2.144,4.823c0.357,1.787,0.715,3.751,0.715,5.359 C251.71,98.213,251.532,99.821,251.353,101.25z" /> <path d="M314.415,81.778h0.536c0.893,0,1.965,0.179,3.037,0.536c1.25,0.357,2.144,0.715,3.037,1.072 c0.894,0.357,1.608,1.072,1.965,1.786c0.357,0.715,0.536,1.608,0.536,2.501v20.187H292.62V87.316c0-1.072,0.179-1.965,0.536-2.68 c0.357-0.715,0.893-1.25,1.965-1.608c0.536-0.179,1.608-0.536,2.858-0.715c1.25-0.178,2.322-0.357,3.216-0.357h0.536v-4.288 h-29.119v4.288h0.536c0.893,0,1.965,0.179,3.037,0.536c1.251,0.357,2.144,0.715,3.037,1.072c0.894,0.357,1.608,1.072,1.965,1.787 c0.357,0.715,0.536,1.608,0.536,2.501v49.127c0,1.071-0.179,2.144-0.536,2.858c-0.357,0.715-1.072,1.25-1.965,1.607 c-0.357,0.179-1.072,0.357-2.858,0.536c-1.429,0.179-2.501,0.179-3.394,0.357h-0.536v4.288h29.119v-4.288h-0.536 c-0.715,0-1.787-0.179-3.216-0.536c-1.25-0.357-2.322-0.535-2.68-0.893c-1.072-0.537-1.608-1.072-1.965-1.787 c-0.357-0.715-0.536-1.607-0.536-2.68V113.22h30.906v23.76c0,1.071-0.179,2.144-0.536,2.858s-1.072,1.25-1.965,1.607 c-0.357,0.179-1.072,0.357-2.858,0.536c-1.429,0.179-2.501,0.179-3.395,0.357h-0.536v4.288h29.119v-4.288h-0.536 c-0.715,0-1.787-0.179-3.216-0.536c-1.25-0.357-2.322-0.535-2.68-0.893c-1.072-0.537-1.607-1.072-1.965-1.787 s-0.536-1.607-0.536-2.68V87.316c0-1.072,0.179-1.965,0.536-2.68c0.357-0.715,0.893-1.25,1.965-1.608 c0.536-0.179,1.608-0.536,2.858-0.715c1.25-0.178,2.322-0.357,3.216-0.357h0.536v-4.288h-29.119V81.778z" /> <path d="M406.596,125.725c-0.357,1.43-1.43,3.752-3.037,6.789s-3.037,5.359-4.466,6.788 c-0.536,0.536-1.251,0.894-2.501,1.251c-1.251,0.357-2.501,0.535-3.752,0.715c-1.072,0.178-2.68,0.178-4.288,0.178h-4.109 c-2.68,0-4.645,0-6.074-0.178c-1.429-0.18-2.322-0.537-3.216-1.072c-0.714-0.536-1.25-1.251-1.429-2.322 c-0.357-1.072-0.357-2.68-0.357-4.645v-20.188h7.146c1.965,0,3.573,0.179,4.824,0.536c1.072,0.356,2.144,1.071,3.037,2.322 c0.536,0.714,1.072,1.965,1.608,3.573c0.536,1.607,0.894,3.215,1.072,4.823v0.536h4.466V96.963h-4.288v0.357 c-0.179,1.25-0.536,2.858-0.893,4.287c-0.536,1.43-1.072,2.68-1.787,3.573c-0.714,1.071-1.787,1.786-2.858,2.144 s-2.858,0.715-5.181,0.715h-7.146V82.136h10.183c1.787,0,3.215,0,4.645,0.178c1.429,0,2.501,0.179,3.573,0.357 c1.786,0.179,3.751,1.608,5.716,4.288c2.144,2.68,3.395,5.181,4.109,7.503l0.179,0.357h4.466V77.491h-53.415v4.288h0.536 c0.893,0,1.965,0.179,3.394,0.536c1.429,0.357,2.501,0.715,3.395,1.072c1.072,0.536,1.608,1.072,1.965,1.786 c0.357,0.715,0.536,1.608,0.536,2.68v48.949c0,1.072-0.179,1.965-0.536,2.68c-0.357,0.715-1.072,1.25-1.965,1.607 c-0.357,0.18-1.072,0.357-3.037,0.536c-1.608,0.179-2.858,0.357-3.751,0.357h-0.536v4.288h57.167l1.429-21.08h-4.287 L406.596,125.725z" /> <path d="M460.01,81.778h0.536c1.072,0,2.501,0.357,4.467,0.893c1.965,0.536,3.394,1.072,4.287,1.608 c0.894,0.714,1.607,1.965,1.965,3.93c0.536,2.144,0.715,5.181,0.715,8.932v30.905l-37.337-50.735h-20.187V81.6h0.536 c1.071,0,2.68,0.536,4.645,1.25s3.395,1.608,4.466,2.68c0.715,0.714,1.43,1.787,1.965,3.216c0.536,1.429,0.715,2.858,0.715,4.287 v33.407c0,4.467-0.179,7.503-0.536,9.289c-0.357,1.787-1.071,3.037-2.144,3.752c-0.357,0.357-1.25,0.715-3.573,1.43 c-1.965,0.535-3.394,0.893-4.287,0.893h-0.536v4.287h28.762v-4.287h-0.535c-0.715,0-2.145-0.357-4.467-0.893 c-2.144-0.537-3.572-1.251-4.287-1.787c-0.894-0.893-1.607-2.322-2.144-4.287c-0.536-2.145-0.715-5.002-0.715-8.933V92.318 l40.374,54.665h4.823V96.784c0-3.394,0.179-6.252,0.536-8.575c0.357-2.144,1.071-3.573,2.144-4.288 c0.715-0.536,1.965-0.893,3.752-1.429c1.786-0.536,3.215-0.714,3.93-0.714h0.536v-4.288h-28.583v4.288H460.01z" /> </g> </svg> </a> </h1> <span class="pipe"></span><a href="https://writings.stephenwolfram.com" class="writings">Writings <svg viewBox="312.131 0 419.71 200"> <g id="writingsSVG"> <path d="M420.941,131.488L420.941,131.488c-2.154-0.07-4.128-1.223-5.248-3.064c-1.103-1.731-2.139-3.562-3.054-5.183 c-6.891-12.237-15.998-23.771-29.493-37.375c-4.692-4.847-10.108-8.938-16.053-12.128l-0.562-0.331 c-0.253-0.143-0.518-0.287-0.793-0.419c-1.489-0.672-1.886-0.551-1.93-0.54c-0.044,0.011-0.32,0.143-0.794,1.279 c-1.599,3.751-2.9,7.622-3.892,11.577c-0.97,3.969-1.797,8.06-2.591,12.029c-0.496,2.502-0.992,5.006-1.543,7.497l-0.066,0.353 c-0.452,2.105-1.202,5.635-5.447,5.998s-5.777-3.054-6.681-5.104c-0.612-1.382-1.128-2.804-1.543-4.256l-12.734-44.102 l-9.515-32.822c-0.188-0.662-0.419-1.312-0.662-2.007c-1.612,0.425-3.331,0.079-4.652-0.937c-1.169-1.037-1.676-2.569-1.533-4.774 c0.099-1.72,0.265-3.451,0.43-5.116c0.077-0.915,0.165-1.841,0.243-2.756c0.077-0.916,0.154-1.775,0.154-2.58 c0-1.577,0-5.767,4.575-6.538c4.829-0.816,6.362,2.205,7.167,4.961c2.602,8.923,5.175,17.85,7.718,26.781 c2.94,10.327,5.902,20.658,8.887,30.992l7.21,25.126c0-0.187,0.077-0.386,0.121-0.573c0.287-1.213,0.551-2.425,0.827-3.638 c0.893-3.947,1.819-8.038,2.855-12.04c0.585-1.913,1.412-3.743,2.458-5.447c2.205-3.958,4.686-5.16,9.118-4.41 c2.019,0.292,3.979,0.898,5.81,1.797c7.361,3.686,14.045,8.592,19.769,14.509c6.957,7.365,13.099,14.146,18.743,20.739 c2.205,2.602,4.267,5.424,6.219,8.147c0.353,0.508,0.717,1.004,1.103,1.512c-0.254-3.782-0.496-7.564-0.75-11.346 c-0.397-5.961-0.786-11.922-1.169-17.883l-0.221-3.374c-0.297-4.311-0.595-8.82-0.694-13.23c-0.209-9.173-1.742-18.401-3.22-27.332 l-0.396-2.403c-0.441-2.668-1.103-5.38-1.72-8.004c-0.475-1.985-0.971-4.035-1.378-6.086c-0.855-4.224-0.504-8.603,1.014-12.635 c0.419-1.103,1.521-4.102,4.686-4.102h0.133c2.315,0.066,3.858,1.566,4.575,4.41c0.188,0.717,0.375,1.444,0.552,2.205 c0.752,2.622,1.323,5.293,1.709,7.994l0.661,5.314c1.301,10.408,2.646,21.18,3.518,31.831c1.014,12.381,1.764,24.983,2.48,37.167 c0.279,4.483,0.551,8.975,0.815,13.473c0.375,5.942,0.75,12.261,0.948,18.512c0.09,1.93-0.381,3.845-1.355,5.513 C424.734,130.367,422.921,131.432,420.941,131.488z" /> <path d="M560.82,121.918c-3.308,0-4.686-2.635-5.248-3.704c-3.562-6.747-7.111-14.102-9.03-22.249l-0.396-1.665 c-0.771-3.241-1.576-6.615-2.117-9.923c0.013-1.077-0.841-1.965-1.918-1.996H542c-2.724-0.529-5.513-1.103-8.302-1.51 c-3.849-0.596-8.313-1.279-12.757-1.808c-1.102-0.077-2.206-0.077-3.308,0c0.177,1.323,0.342,2.547,0.519,3.782 c0.777,6.479,2.329,12.842,4.619,18.952c1.5,3.826,3.308,5.977,6.229,7.178s5.513,2.437,7.597,3.406 c0.761,0.359,1.498,0.768,2.205,1.225l1.025,0.617l1.995,1.169l-1.488,1.786c-1.442,1.78-3.745,2.627-5.998,2.205 c-3.095-0.257-6.168-0.736-9.194-1.434c-2.815-0.649-5.268-2.369-6.836-4.796c-0.562-0.86-1.169-1.698-1.819-2.569 c-0.97-1.266-1.864-2.587-2.679-3.957c-2.28-4.252-3.774-8.879-4.41-13.661c-0.552-3.473-1.103-6.946-1.731-10.496l-0.54-3.197 c-4.367-0.299-8.754-0.181-13.099,0.353l0.529,2.867c0.673,3.627,1.312,7.056,2.205,10.441c0.894,3.385,1.886,6.615,2.889,9.923 c0.849,2.768,1.731,5.635,2.514,8.49c0.348,1.506,0.507,3.051,0.475,4.598c0,0.572,0,1.102,0.065,1.676l0.1,1.367l-1.257,0.562 c-2.58,1.169-4.829,0.64-6.317-1.499l-0.529-0.75c-0.899-1.121-1.642-2.36-2.205-3.683l-0.231-0.64 c-1.687-4.531-3.429-9.229-4.752-13.991c-1.103-3.903-1.963-7.895-2.812-11.764c-0.396-1.83-0.805-3.668-1.224-5.513 c-0.133-0.551-0.287-1.103-0.463-1.687c-0.773,0.015-1.542-0.109-2.271-0.364c-1.563-0.438-2.897-1.46-3.727-2.855 c-0.364-0.772-1.301-3.473,2.304-5.722l0.1-0.066c0.385-0.28,0.824-0.475,1.29-0.573c0.849-0.143,0.959-0.166,0.706-1.852 c-0.298-1.734,0.214-3.509,1.389-4.818c1.165-1.224,2.827-1.845,4.51-1.687c3.1,0.222,5.565,2.688,5.788,5.788 c0.012,0.17,0.033,0.34,0.066,0.507c0.146,0.207,0.312,0.399,0.496,0.573c3.638,0,7.343-0.066,10.937-0.166h1.103l-0.231-2.37 c-0.253-2.79-0.529-5.678-0.849-8.49c-1.235-10.768-2.492-21.536-3.771-32.304l-0.65-5.513c-0.316-2.69-0.644-5.38-0.981-8.071 l-0.529-4.333c-0.463-3.892,1.389-6.615,4.851-7.111c1.54-0.276,3.123,0.126,4.345,1.103c1.509,1.381,2.349,3.346,2.304,5.392 c0,1.18,0,2.359,0,3.506c0,1.621,0,3.143,0.133,4.653c0.419,4.608,0.926,9.283,1.411,13.815c0.242,2.282,0.496,4.575,0.728,6.869 c0.254,2.458,0.496,4.928,0.75,7.387c0.33,3.396,0.672,6.802,1.036,10.198c0.408,3.859,0.849,7.718,1.279,11.533l0.396,3.506 l27.045,3.793c0.122-0.32,0.254-0.629,0.375-0.948c1.103-2.624,3.308-3.848,5.513-3.032c1.719,0.695,3.066,2.079,3.716,3.815 c0.425,1.399,0.695,2.841,0.805,4.3c0.066,0.606,0.133,1.213,0.231,1.808c1.673,11.613,4.4,23.049,8.148,34.168 c0.198,0.562,0.451,1.102,0.716,1.72c0.265,0.617,0.662,1.499,0.938,2.326c0.211,0.739,0.318,1.503,0.319,2.271 c0,0.286,0,0.573,0.056,0.87l0.177,1.765l-1.742,0.353C561.76,121.861,561.291,121.912,560.82,121.918z" /> <path d="M713.775,141.665h-0.783c-4.397-0.225-8.778-0.703-13.12-1.434l-1.676-0.243c-1.169-0.164-4.719-0.672-4.41-4.498 c0.045-1.053,0.538-2.036,1.356-2.701c1.103-0.882,2.745-1.102,4.994-0.771c1.314,0.244,2.645,0.391,3.98,0.441 c3.958,0,8.181,0,12.426-0.133c1.009-0.105,1.985-0.422,2.866-0.926c1.323-0.684,2.139-1.5,2.304-2.293 c0.023-1.015-0.376-1.993-1.102-2.701c-2.385-2.823-4.964-5.476-7.719-7.939c-4.686-4.266-8.621-7.64-12.392-10.617 c-9.328-7.364-16.538-14.575-21.875-22.05c-6.482-8.986-4.498-17.222,4.719-24.509c7.718-6.119,16.473-7.607,28.666-4.686 c2.836,0.819,5.523,2.084,7.961,3.749c1.499,0.737,2.562,2.139,2.866,3.782c0.231,1.995-1.103,3.594-2.139,4.619 c-1.506,1.441-3.162,2.716-4.939,3.804c-1.394,0.779-3.111,0.685-4.41-0.243c-0.896-1.023-1.271-2.402-1.015-3.738 c0.054-0.484,0.161-0.961,0.32-1.422c-0.759-0.597-1.703-0.909-2.669-0.882c-0.874-0.022-1.744-0.122-2.602-0.298l-0.794-0.132 c-5.887-0.94-11.882,0.845-16.295,4.852c-1.657,1.266-2.753,3.13-3.055,5.193c-0.005,2.044,0.827,4,2.305,5.413 c6.737,7.715,14.114,14.848,22.051,21.323c4.663,3.704,9.019,7.872,13.23,11.919c1.422,1.355,2.845,2.723,4.289,4.079 c1.154,1.159,2.128,2.486,2.888,3.937c2.01,3.247,2.394,7.245,1.037,10.815c-1.52,3.435-4.545,5.971-8.192,6.868 C719.905,141.135,716.852,141.613,713.775,141.665z" /> <path d="M449.178,120.717h-0.54c-2.794-0.27-5.002-2.486-5.26-5.281c-0.396-2.459-0.782-4.906-1.103-7.365 c-0.871-5.578-1.764-11.367-2.866-16.979c-0.882-4.476-2.205-8.997-3.451-13.374c-0.298-1.103-0.606-2.084-0.904-3.131 c-0.272-0.779-0.643-1.52-1.103-2.205c-0.242-0.43-0.484-0.871-0.705-1.301c-1.643-3.308-0.904-6.527,1.83-8.125 c1.455-0.852,3.194-1.075,4.818-0.618c1.691,0.449,3.133,1.557,4.002,3.076c0.425,0.733,0.74,1.524,0.938,2.348 c0.97,4.179,1.94,8.357,2.921,12.624c0.364-2.205,0.761-4.41,1.246-6.692c0.802-3.429,1.985-6.757,3.528-9.923 c3.528-7.442,11.963-11.235,21.488-9.658c0.86,0.137,1.691,0.416,2.459,0.827c2.078,1.004,3.285,3.222,2.999,5.513 c-0.408,3.109-3.374,3.572-4.631,3.76c-0.782,0.118-1.577,0.118-2.359,0c-0.254,0-0.519-0.066-0.783-0.077 c-6.615-0.375-8.82,1.94-10.573,6.361c-3.01,7.497-4.035,15.149-5.05,24.377c-0.342,3.175-0.375,6.482-0.407,9.691 c0,1.93,0,3.914-0.133,5.888c-0.088,1.962-0.38,3.909-0.871,5.81C454.156,118.88,451.844,120.756,449.178,120.717z" /> <path d="M546.135,59.25c-0.18,0.011-0.36,0.011-0.541,0c-1.195-0.199-2.178-1.051-2.547-2.205 c-1.289-4.091-2.514-8.093-3.506-12.128c-0.684-2.823,1.103-5.513,4.212-6.406c2.506-0.891,5.259,0.417,6.152,2.921 c0.49,1.245,0.888,2.523,1.19,3.826c0.133,0.507,0.265,1.025,0.408,1.532l0.54,1.896l-1.015,0.287c0,0.221-0.055,0.452-0.077,0.673 c-0.198,1.665-0.396,3.385-0.661,5.083c-0.184,1.078-0.618,2.097-1.268,2.977C548.365,58.657,547.29,59.231,546.135,59.25z" /> <path d="M482.981,53.561l-1.709-1.103c-4.697-2.844-5.612-7.155-6.108-10.959c-0.375-2.933,1.688-5.436,4.918-5.954 c3.23-0.519,5.512,1.025,6.174,3.859c0.904,4.013,0.177,8.048-2.205,12.348L482.981,53.561z" /> <path d="M677.094,55.876c-0.234-2.991-1.067-5.903-2.447-8.567c-1.051-2.274-3.35-3.711-5.854-3.66 c-4.201,0.022-7.277,0.97-9.714,2.988c-6.683,5.544-11.577,12.939-14.068,21.257c-3.003,9.579-4.396,19.59-4.123,29.625v1.488 c0.079,1.039,0.079,2.082,0,3.12c-0.664,0.172-1.338,0.304-2.018,0.397c-0.761,0.132-1.676,0.286-2.778,0.507 c-7.332,1.488-13.804,0.187-19.317-3.87c-5.034-3.883-9.357-8.609-12.777-13.969c-1.104-1.665-2.205-3.308-3.309-4.972 c-2.381-3.672-4.84-7.464-7.562-11.025c-2.459-3.22-5.546-5.017-8.678-5.017c-2.23,0.031-4.364,0.915-5.965,2.47 c-0.705-1.478-1.443-2.966-2.281-4.41c-1.057-1.778-2.251-3.47-3.572-5.061c-1.531-1.875-4.287-2.165-6.175-0.651 c-1.95,1.261-2.644,3.786-1.609,5.866c0.156,0.351,0.345,0.687,0.562,1.003c0.083,0.115,0.157,0.236,0.22,0.364 c0.606,1.478,1.257,2.944,1.919,4.41c1.519,3.218,2.822,6.533,3.903,9.923c3.045,10.105,4.471,20.628,4.223,31.18 c0.006,2.899,0.347,5.789,1.014,8.61c0.257,1.77,1.383,3.293,2.999,4.058c1.786,0.659,3.784,0.373,5.314-0.761 c2.012-1.247,3.07-3.586,2.679-5.92l-0.595-5.679c-0.529-5.304-1.136-10.783-1.632-16.163l-0.056-0.65 c-0.496-5.259-0.948-10.221,0.231-15.127c0.091-0.323,0.221-0.634,0.387-0.926c1.428,1.102,2.626,2.473,3.527,4.036 c4.058,7.012,9.129,15.148,16.075,22.348c7.276,7.553,16.703,10.86,27.993,9.835l7.409-0.673c0,0.1,0,0.21,0,0.309 c0.231,1.456,0.452,2.823,0.629,4.19c0.221,1.741,0.407,3.483,0.595,5.226c0.375,3.43,0.75,6.979,1.4,10.452 c1.136,6.13,2.371,12.337,3.562,18.335c1.521,7.476,3.054,15.215,4.41,22.834c0.698,4.063,0.831,8.204,0.396,12.305 c-0.118,1.707-1.104,3.235-2.612,4.046c-1.84,0.905-4.008,0.839-5.789-0.177c-1.195-0.703-2.506-1.191-3.869-1.444 c-1.101-0.138-2.206,0.21-3.029,0.952c-1.564,1.41-1.689,3.822-0.278,5.388c2.844,3.539,6.218,5.325,10.055,5.325 c0.231,0,0.452,0,0.661-0.021c2.165-0.037,4.312-0.409,6.362-1.104c3.429-1.312,7.497-3.451,8.5-8.512 c0.565-2.493,0.763-5.057,0.585-7.607c-0.529-5.469-1.225-11.874-2.404-18.423c-1.18-6.55-2.458-13.175-3.682-19.593 c-1.511-7.717-3.043-15.699-4.41-23.561l-0.122-0.694c-0.672-3.749-1.334-7.618-0.672-11.29l1.422-0.85 c1.715-0.924,3.322-2.033,4.796-3.307c3.513-3.107,6.731-6.533,9.614-10.232c1.267-1.897,2.209-3.991,2.79-6.196 c0.297-0.893,0.562-1.731,0.882-2.547C674.238,77.376,677.832,67.145,677.094,55.876z M665.771,69.735l-1.411,3.914 c-1.532,4.245-3.109,8.644-4.752,12.922c-1.693,4.485-4.831,8.278-8.92,10.783c-0.011-0.118-0.011-0.235,0-0.353 c0.232-11.874,1.896-21.125,5.271-29.107c2.58-6.031,6.186-10.287,11.025-12.977c0.471,0.565,0.693,1.297,0.617,2.028 C667.788,61.286,667.168,65.623,665.771,69.735z" /> </g> </svg> </a> <nav id="nav"> <ul> <li> <ul class="links"> <li class="about"><a href="//www.stephenwolfram.com/about/">ABOUT</a></li> <li class="blog"><a href="//writings.stephenwolfram.com">WRITINGS</a></li> <li class="publications"><a href="//www.stephenwolfram.com/publications/">PUBLICATIONS</a></li> <li class="media"><a href="//www.stephenwolfram.com/media/">MEDIA</a></li> <li class="scrapbook"><a href="//www.stephenwolfram.com/scrapbook/">SCRAPBOOK</a></li> <li class="contact"><a href="//www.stephenwolfram.com/contact/">CONTACT</a></li> </ul> </li> <li> <ul class="social"> <li><a class="twitter" href="//x.com/stephen_wolfram" class="big-social-icon twitter" title="X" target="_blank"></a></li> <li><a class="facebook" href="//www.facebook.com/Stephen-Wolfram-188916357807416/" class="big-social-icon facebook" title="Facebook" target="_blank"></a></li> <li><a class="linkedin" href="//www.linkedin.com/in/stephenwolfram" class="big-social-icon linkedin" title="LinkedIn" target="_blank"></a></li> <li><a class="soundcloud" href="https://soundcloud.com/stephenwolfram/" class="big-social-icon soundcloud" title="SoundCloud" target="_blank"></a></li> <li><a class="twitch" href="https://www.twitch.tv/stephen_wolfram" class="big-social-icon twitch" title="Twitch" target="_blank"></a></li> </ul> </li> </ul> </nav> </div> <div class="stripe"></div> </header> <script> $('.hamburger').click(function(e){ e.stopPropagation(); $('.links').toggleClass('show'); $('#header > .inner').toggleClass('open'); if($('.overlay').length < 1 && !$('.links').hasClass('hide')) { $('#header').append('<div class="overlay">'); } else { $('.overlay').remove(); } }); $('body').click(function(){ $('.links').removeClass('show'); $('.overlay').remove(); $('#header > .inner').removeClass('open'); }); </script> <div class="writings-sidebar-additions"> <div class="inner"> <div class="sidebar-additions"> <div class="recent-categories"><a href="https://writings.stephenwolfram.com">Recent</a> | <div class="categories-list-wrapper"> <button class="categories">Categories</button> <div class="categories-list-menu hide"> <ul class="categories-list"> <li><a href="/category/artificial-intelligence">Artificial Intelligence</a></li><li><a href="/category/big-picture">Big Picture</a></li><li><a href="/category/companies-and-business">Companies &amp; Business</a></li><li><a href="/category/computational-science">Computational Science</a></li><li><a href="/category/computational-thinking">Computational Thinking</a></li><li><a href="/category/data-science">Data Science</a></li><li><a href="/category/education">Education</a></li><li><a href="/category/future-perspectives">Future Perspectives</a></li><li><a href="/category/historical-perspectives">Historical Perspectives</a></li><li><a href="/category/language-and-communication">Language &amp; Communication</a></li><li><a href="/category/life-and-times">Life &amp; Times</a></li><li><a href="/category/life-science">Life Science</a></li><li><a href="/category/mathematica">Mathematica</a></li><li><a href="/category/mathematics">Mathematics</a></li><li><a href="/category/new-kind-of-science">New Kind of Science</a></li><li><a href="/category/new-technology">New Technology</a></li><li><a href="/category/personal-analytics">Personal Analytics</a></li><li><a href="/category/philosophy">Philosophy</a></li><li><a href="/category/physics">Physics</a></li><li><a href="/category/ruliology">Ruliology</a></li><li><a href="/category/software-design">Software Design</a></li><li><a href="/category/wolfram-alpha">Wolfram|Alpha</a></li><li><a href="/category/wolfram-language">Wolfram Language</a></li><li><a href="/category/other">Other</a></li> </ul> </div> </div> </div> <span class="pipe">|</span> <form class="search-link" method="get" action="https://writings.stephenwolfram.com/"> <svg version="1.0" class="search-button" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 18.2 18.5" enable-background="new 0 0 18.2 18.5" xml:space="preserve"> <g> <path class="circle" fill="#c42c1f" d="M7.7,14.2H7.6c-3.6,0-6.5-2.9-6.5-6.4V7.7c0-3.5,2.9-6.4,6.5-6.4h0.1 c3.6,0,6.5,2.9,6.5,6.4v0.1C14.2,11.3,11.3,14.2,7.7,14.2z M7.6,2.5c-2.9,0-5.2,2.3-5.2,5.1v0.1c0,2.8,2.3,5.1,5.2,5.1h0.1 c2.9,0,5.2-2.3,5.2-5.1V7.7C12.9,4.8,10.6,2.5,7.6,2.5L7.6,2.5z" /> <g> <path class="handle" fill="#c42c1f" d="M16.8,15.4l-4.4-4.4l-1.5,1.6l4.4,4.5c0.2,0.2,0.5,0.3,0.7,0.3s0.5-0.1,0.7-0.3 C17.2,16.5,17.2,15.8,16.8,15.4z" /> </g> </g> </svg> <input class="search-field hide" type="text" value="" name="s" placeholder="Search Writings" /> <span class="close hide">&times;</span> </form> </div> </div> </div> <div class="inner"> <div id="content"><script type="text/javascript"> $(document).ready(function() { $("#join-small").addClass('join-small-js'); $("#exit-button").addClass('exit-button-js'); $("#respond").addClass('respond-js'); }); </script> <article id="postid-49776" > <div id="toc-bar-wrap"> <div id="toc-bar"> <div id="toc-bar-inner"> <span class="toc-button">Contents</span> <div class="toc-menu hide"> <ul class='table-of-contents'> <li class='toplink'><a href='#top'>Top</a></li> <li><a href='#turning-llm-capabilities-into-functions'>Turning LLM Capabilities into Functions</a></li> <li><a href='#functions-from-examples'>Functions from Examples</a></li> <li><a href='#pre-written-prompts-and-the-wolfram-prompt-repository'>Pre-written Prompts and the Wolfram Prompt Repository</a></li> <li><a href='#how-it-all-works'>How It All Works</a></li> <li><a href='#what-about-the-llm-inside'>What about the LLM Inside?</a></li> <li><a href='#ai-wrangling-and-the-art-of-prompts'>AI Wrangling and the Art of Prompts</a></li> <li><a href='#symbolic-chats'>Symbolic Chats</a></li> <li><a href='#this-is-just-the-beginning'>This Is Just the Beginning...</a></li> </ul> </div> <span class="toc-title">The New World of LLM Functions: Integrating LLM Technology into the Wolfram Language</span> </div> </div> </div> <h1 class="blog-post-title">The New World of LLM Functions: Integrating LLM Technology into the Wolfram Language</h1> <time class="date" datetime="2023-05-23">May 23, 2023</time> <div class="post_content" > <style type="text/css">body.home article#postid-49776 #topbanner {display: none !important;}div.post_content p#topbanner a:before {content: "◼"; margin-left: -15px; font-size: .6rem; line-height: 1; color: #a4a4a4; top: -1px; position: relative; left: -3px;}</style> <p id="topbanner" style="background: #f4fcff;font-size: .9rem;font-family: 'Source Sans Pro',SANS-SERIF;padding: 0.75rem 1.5rem;line-height: 1.5;border: 2px solid #a9c8d9;max-width: 621px;font-style: italic;margin-bottom: 25px;">This is part of an ongoing series about our LLM-related technology:<a href="https://writings.stephenwolfram.com/2023/03/chatgpt-gets-its-wolfram-superpowers/" style="font-style: normal;display: block;margin-left: 1.2rem;line-height: 1.4;">ChatGPT Gets Its “Wolfram Superpowers”!</a><a href="https://writings.stephenwolfram.com/2023/04/instant-plugins-for-chatgpt-introducing-the-wolfram-chatgpt-plugin-kit/" style="font-style: normal;display: block;margin-left: 1.2rem;line-height: 1.4;">Instant Plugins for ChatGPT: Introducing the Wolfram ChatGPT Plugin Kit</a><a href="https://writings.stephenwolfram.com/2023/05/the-new-world-of-llm-functions-integrating-llm-technology-into-the-wolfram-language/" style="font-style: normal;font-weight: bold;display: block;margin-left: 1.2rem;line-height: 1.4;">The New World of LLM Functions: Integrating LLM Technology into the Wolfram Language</a><a href="https://writings.stephenwolfram.com/2023/06/prompts-for-work-play-launching-the-wolfram-prompt-repository" style="font-style: normal;display: block;margin-left: 1.2rem;line-height: 1.4;">Prompts for Work &#038; Play: Launching the Wolfram Prompt Repository</a><a href="https://writings.stephenwolfram.com/2023/06/introducing-chat-notebooks-integrating-llms-into-the-notebook-paradigm" style="font-style: normal;display: block;margin-left: 1.2rem;line-height: 1.4;">Introducing Chat Notebooks: Integrating LLMs into the Notebook Paradigm</a></p> <p><img class="aligncenter" title="The New World of LLM Functions: Integrating LLM Technology into the Wolfram Language" src="https://content.wolfram.com/sites/43/2023/05/blog-hero-nestlist-llm-function.png" alt="The New World of LLM Functions: Integrating LLM Technology into the Wolfram Language" width="620" height="396" /></p> <h2 id="turning-llm-capabilities-into-functions">Turning LLM Capabilities into Functions</h2> <p>So far, we mostly think of LLMs as things we interact directly with, say through chat interfaces. But what if we could take <a href="https://writings.stephenwolfram.com/2023/02/what-is-chatgpt-doing-and-why-does-it-work/">LLM functionality</a> and “package it up” so that we can routinely use it as a component inside anything we’re doing? Well, that’s what our new <a href="https://reference.wolfram.com/language/ref/LLMFunction.html"><tt>LLMFunction</tt></a> is about.<span id="more-49776"></span></p> <div id="gpt-stripe" style="background: #f6fcff87;padding: 0.75rem 1.5rem;border: 1px solid #aeccd987;font-family: 'Source Sans Pro', sans-serif;margin-bottom: 2.5rem;max-width: 620px;/* font-size: .6rem; */"> <p style="font-size: .85rem;color: #3f5f6a;line-height: 1.5;padding-bottom: 0;display: inline;">The functionality described here will be built into the upcoming version of <a href="https://www.wolfram.com/language/">Wolfram Language</a> (Version 13.3). To install it in the now-current version (Version 13.2), use </p> <div class="wolfram-c2c-wrapper writtings-c2c_above" data-c2c-file="https://content.wolfram.com/sites/43/2023/05/sw052223pacletinstallimg1_copy.txt" data-c2c-type="text/html" id="writtings-c2c_above" style="font-size: .9rem;color: #3f5f6a;"><tt style="">PacletInstall["Wolfram/LLMFunctions"]</tt>.</div> <p style="font-size: .85rem;color: #3f5f6a;line-height: 1.5;padding-bottom: 0;display: inline;">You will also need an API key for the <a href="https://openai.com/">OpenAI</a> LLM or another LLM.</p> </div> <p>Here’s a very simple example—an <a href="https://reference.wolfram.com/language/ref/LLMFunction.html"><tt>LLMFunction</tt></a> that rewrites a sentence in active voice:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg1_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg1.png' alt='' title='' width='612' height='44'> </div> </p></div> <p>Here’s another example—an <a href="https://reference.wolfram.com/language/ref/LLMFunction.html"><tt>LLMFunction</tt></a> with three arguments, that finds word analogies:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg2_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg2.png' alt='' title='' width='505' height='45'> </div> </p></div> <p>And here’s one more example—that now uses some “everyday knowledge” and “creativity”:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg3_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg3.png' alt='' title='' width='556' height='46'> </div> </p></div> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg4_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg4.png' alt='' title='' width='550' height='46'> </div> </p></div> <p>In each case here what we’re doing is to use natural language to specify a function, that’s then implemented by an LLM. And even though there’s a lot going on inside the LLM when it evaluates the function, we can treat the <a href="https://reference.wolfram.com/language/ref/LLMFunction.html"><tt>LLMFunction</tt></a> itself in a very “lightweight” way, using it just like any other function in the <a href="https://www.wolfram.com/language/">Wolfram Language</a>. </p> <p>Ultimately what makes this possible is the symbolic nature of the Wolfram Language—and the ability to represent any function (or, for that matter, anything else) as a <a href="https://www.wolfram.com/language/fast-introduction-for-programmers/en/symbolic-expressions/">symbolic object</a>. To the Wolfram Language 2 + 3 is <tt><a href="http://reference.wolfram.com/language/ref/Plus.html">Plus</a></tt><tt>[2,3]</tt>, where <tt><a href="http://reference.wolfram.com/language/ref/Plus.html">Plus</a></tt> is just a symbolic object. And for example doing a very simple piece of <a href="https://www.wolfram.com/language/elementary-introduction/3rd-ed/22-machine-learning.html">machine learning</a>, we again get a symbolic object</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg5_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg5.png' alt='' title='' width='584' height='84'> </div> </p></div> <p>which can be <a href="https://www.wolfram.com/language/elementary-introduction/3rd-ed/26-pure-anonymous-functions.html">used as a function</a> and applied to an argument to get a result:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg6_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg6.png' alt='' title='' width='392' height='74'> </div> </p></div> <p>And so it is with <a href="https://reference.wolfram.com/language/ref/LLMFunction.html"><tt>LLMFunction</tt></a>. On its own, <a href="https://reference.wolfram.com/language/ref/LLMFunction.html"><tt>LLMFunction</tt></a> is just a symbolic object (we’ll explain later why it’s displayed like this):</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223activevoiceimg1_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223activevoiceimg1.png' alt='' title='' width='378' height='84'> </div> </p></div> <p>But when we apply it to an argument, the LLM does its work, and we get a result:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223activevoiceimg2_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223activevoiceimg2.png' alt='' title='' width='647' height='81'> </div> </p></div> <p>If we want to, we can assign a name to the <a href="https://reference.wolfram.com/language/ref/LLMFunction.html"><tt>LLMFunction</tt></a></p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223activevoiceimg3_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223activevoiceimg3.png' alt='' title='' width='459' height='51'> </div> </p></div> <p>and now we can use this name to refer to the function:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg10_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg10.png' alt='' title='' width='329' height='46'> </div> </p></div> <p>It’s all rather elegant and powerful—and connects quite seamlessly into the whole structure of the Wolfram Language. So, for example, just as we can map a symbolic object <tt>f</tt> over a list</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg11_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg11.png' alt='' title='' width='206' height='45'> </div> </p></div> <p>so now we can map <a href="https://reference.wolfram.com/language/ref/LLMFunction.html"><tt>LLMFunction</tt></a> over a list:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg12_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg12.png' alt='' title='' width='457' height='45'> </div> </p></div> <p>And just as we can progressively nest <tt>f</tt></p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg13_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg13.png' alt='' title='' width='486' height='45'> </div> </p></div> <p>so now we can progressively nest an <a href="https://reference.wolfram.com/language/ref/LLMFunction.html"><tt>LLMFunction</tt></a><tt>—</tt>here producing a “funnier and funnier” version of a sentence:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg14_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg14.png' alt='' title='' width='644' height='261'> </div> </p></div> <p>We can similarly use <tt><a href="http://reference.wolfram.com/language/ref/Outer.html">Outer</a></tt></p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg15_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg15.png' alt='' title='' width='409' height='45'> </div> </p></div> <p>to produce an array of <a href="https://reference.wolfram.com/language/ref/LLMFunction.html"><tt>LLMFunction</tt></a> results:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg16_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg16.png' alt='' title='' width='568' height='172'> </div> </p></div> <p>It’s remarkable what becomes possible when one integrates LLMs with the Wolfram Language. One thing one can do is take results of Wolfram Language computations (here a very simple one) and feed them into an LLM:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg17_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg17.png' alt='' title='' width='408' height='46'> </div> </p></div> <p>We can also just directly feed in data:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg18_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg18.png' alt='' title='' width='574' height='118'> </div> </p></div> <p>But now we can take this textual output and apply another <a href="https://reference.wolfram.com/language/ref/LLMFunction.html"><tt>LLMFunction</tt></a> to it (<tt>%</tt> stands for the last output):</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg19_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg19.png' alt='' title='' width='502' height='45'> </div> </p></div> <p>And then perhaps yet another <a href="https://reference.wolfram.com/language/ref/LLMFunction.html"><tt>LLMFunction</tt></a>:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg20_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg20.png' alt='' title='' width='514' height='45'> </div> </p></div> <p>If we want, we can compose these functions together (<tt>f@x</tt> is equivalent to <tt>f[x]</tt>):</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg21_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg21.png' alt='' title='' width='514' height='118'> </div> </p></div> <p>As another example, let’s generate some random words:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg22_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg22.png' alt='' title='' width='286' height='45'> </div> </p></div> <p>Now we can use these as “input data” for an <a href="https://reference.wolfram.com/language/ref/LLMFunction.html"><tt>LLMFunction</tt></a>:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg23_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg23.png' alt='' title='' width='578' height='94'> </div> </p></div> <p>The input for an <a href="https://reference.wolfram.com/language/ref/LLMFunction.html"><tt>LLMFunction</tt></a> doesn’t have to be “immediately textual”:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg24_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg24.png' alt='' title='' width='480' height='46'> </div> </p></div> <p>By default, though, the output from <a href="https://reference.wolfram.com/language/ref/LLMFunction.html"><tt>LLMFunction</tt></a> is purely textual:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg25_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg25.png' alt='' title='' width='450' height='70'> </div> </p></div> <p>But it doesn’t have to be that way. By giving a second argument to <a href="https://reference.wolfram.com/language/ref/LLMFunction.html"><tt>LLMFunction</tt></a> you can say you want actual, structured computable output. And then through a mixture of “LLM magic” and <a href="https://www.wolfram.com/natural-language-understanding/">natural language understanding</a> capabilities built into the Wolfram Language, the <a href="https://reference.wolfram.com/language/ref/LLMFunction.html"><tt>LLMFunction</tt></a> will attempt to interpret output so it’s given in a specified, computable form.</p> <p>For example, this gives output as actual <a href="https://www.wolfram.com/language/elementary-introduction/3rd-ed/07-colors-and-styles.html">Wolfram Language colors</a>:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg26_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg26.png' alt='' title='' width='512' height='70'> </div> </p></div> <p>And here we’re asking for output as a Wolfram Language <a href="https://reference.wolfram.com/language/ref/entity/City.html"><tt>"City"</tt> entity</a>:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg27_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg27.png' alt='' title='' width='653' height='58'> </div> </p></div> <p>Here’s a slightly more elaborate example where we ask for a list of cities:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg28_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg28.png' alt='' title='' width='623' height='84'> </div> </p></div> <p>And, of course, this is a computable result, that we can for example immediately plot:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg29_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg29.png' alt='' title='' width='253' height='148'> </div> </p></div> <p>Here’s another example, again tapping the “common-sense knowledge” of the LLM:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg30_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg30.png' alt='' title='' width='618' height='69'> </div> </p></div> <p>Now we can immediately use this <a href="https://reference.wolfram.com/language/ref/LLMFunction.html"><tt>LLMFunction</tt></a> to sort objects in decreasing order of size:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg31_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg31.png' alt='' title='' width='633' height='94'> </div> </p></div> <p>An important use of LLM functions is in extracting structured data from text. Imagine we have the text:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg32_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg32B.png' alt='' title='' width='631' height='110'> </div> </p></div> <p>Now we can start asking questions—and getting back computable answers. Let’s define:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg33_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg33.png' alt='' title='' width='935' height='56'> </div> </p></div> <p>Now we can “ask a quantity question” based on that text:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg34_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg34.png' alt='' title='' width='305' height='47'> </div> </p></div> <p>And we can go on, getting back structured data, and computing with it:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg35_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg35.png' alt='' title='' width='468' height='73'> </div> </p></div> <p>There’s often a lot of “common sense” involved. Like here the LLM has to “figure out” that by “mass” we mean “body weight”:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg36_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg36.png' alt='' title='' width='296' height='49'> </div> </p></div> <p>Here’s another sample piece of text:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg37_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/otextA.png' alt='' title='' width='582' height='246'> </div> </p></div> <p>And once again we can use <a href="https://reference.wolfram.com/language/ref/LLMFunction.html"><tt>LLMFunction</tt></a> to ask questions about it, and get back structured results:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg38_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg38.png' alt='' title='' width='571' height='142'> </div> </p></div> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg39_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg39.png' alt='' title='' width='587' height='107'> </div> </p></div> <p>There’s a lot one can do with <a href="https://reference.wolfram.com/language/ref/LLMFunction.html"><tt>LLMFunction</tt></a>. Here’s an example of an <a href="https://reference.wolfram.com/language/ref/LLMFunction.html"><tt>LLMFunction</tt></a> for writing Wolfram Language:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg40_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg40.png' alt='' title='' width='592' height='46'> </div> </p></div> <p>The result is a string. But if we’re brave, we can turn it into an expression, which will immediately be evaluated:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg41_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg41.png' alt='' title='' width='249' height='45'> </div> </p></div> <p>Here’s a “heuristic conversion function”, where we’ve bravely specified that we want the result as an expression:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg42_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg42.png' alt='' title='' width='526' height='70'> </div> </p></div> <h2 id="functions-from-examples">Functions from Examples</h2> <p>LLMs—like typical <a href="https://writings.stephenwolfram.com/2023/02/what-is-chatgpt-doing-and-why-does-it-work/#neural-nets">neural nets</a>—are built by <a href="https://writings.stephenwolfram.com/2023/02/what-is-chatgpt-doing-and-why-does-it-work/#machine-learning-and-the-training-of-neural-nets">learning from examples</a>. Initially those examples include billions of webpages, etc. But LLMs also have an uncanny ability to “keep on learning”, even from very few examples. And <a href="https://reference.wolfram.com/language/ref/LLMExampleFunction.html"><tt>LLMExampleFunction</tt></a> makes it easy to give examples, and then have the LLM apply what it’s learned from them.</p> <p>Here we’re giving just one example of a simple structural rearrangement, and—rather remarkably—the LLM successfully generalizes this and is immediately able to do the “correct” rearrangement in a more complicated case:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg43_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg43.png' alt='' title='' width='499' height='45'> </div> </p></div> <p>Here we’re again giving just one example—and the LLM successfully figures out to sort in numerical order, with letters before numbers:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg44_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg44.png' alt='' title='' width='491' height='45'> </div> </p></div> <p><a href="https://reference.wolfram.com/language/ref/LLMExampleFunction.html"><tt>LLMExampleFunction</tt></a> is pretty good at picking up on “typical things one wants to do”:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg45_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg45.png' alt='' title='' width='526' height='46'> </div> </p></div> <p>But sometimes it’s not quite sure what’s wanted:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg46_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg46.png' alt='' title='' width='526' height='46'> </div> </p></div> <p>Here’s another case where the LLM gives a good result, effectively also pulling in some general knowledge (of the meaning of ♂ and ♀):</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg47_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg47.png' alt='' title='' width='573' height='69'> </div> </p></div> <p>One powerful way to use <a href="https://reference.wolfram.com/language/ref/LLMExampleFunction.html"><tt>LLMExampleFunction</tt></a> is in converting between formats. Let’s say we produce the following output:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg48_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg48.png' alt='' title='' width='499' height='357'> </div> </p></div> <p>But instead of this “ASCII art”-like rendering, we want something that can immediately be given as input to Wolfram Language. What <a href="https://reference.wolfram.com/language/ref/LLMExampleFunction.html"><tt>LLMExampleFunction</tt></a> lets us do is give one or more examples of what transformation we want to do. We don’t have to write a program that does string manipulation, etc. We just have to give an example of what we want, and then in effect have the LLM “generalize” to all the cases we need.</p> <p>Let’s try a single example, based on how we’d like to transform the first “content line” of the output:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg49_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg49.png' alt='' title='' width='567' height='334'> </div> </p></div> <p>And, yes, this basically did what we need, and it’s straightforward to get it into a final Wolfram Language form:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg50_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg50.png' alt='' title='' width='488' height='298'> </div> </p></div> <p>So far we’ve just seen <a href="https://reference.wolfram.com/language/ref/LLMExampleFunction.html"><tt>LLMExampleFunction</tt></a> doing essentially “structure-based” operations. But it can also do more “meaning-based” ones:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg51_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg51.png' alt='' title='' width='625' height='46'> </div> </p></div> <p>Often one ends up with something that can be thought of as an “analogy question”: </p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg52_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg52.png' alt='' title='' width='451' height='43'> </div> </p></div> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg53_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg53.png' alt='' title='' width='435' height='44'> </div> </p></div> <p>When it comes to more computational situations, it can do OK if one’s asking about things which are part of the corpus of “common-sense computational knowledge”:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg54_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg54.png' alt='' title='' width='419' height='43'> </div> </p></div> <p>But if there’s “actual computation” involved, it typically fails (the right answer here is <nobr>5! + 5 = 125):</nobr></p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg55_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg55.png' alt='' title='' width='443' height='43'> </div> </p></div> <p>Sometimes it’s hard for <a href="https://reference.wolfram.com/language/ref/LLMExampleFunction.html"><tt>LLMExampleFunction</tt></a> to figure out what you want just from examples you give. Here we have in mind finding animals of the same color—but <a href="https://reference.wolfram.com/language/ref/LLMExampleFunction.html"><tt>LLMExampleFunction</tt></a> doesn’t figure that out:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg56_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg56.png' alt='' title='' width='637' height='44'> </div> </p></div> <p>But if we add a “hint”, it’ll nail it:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg57_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg57.png' alt='' title='' width='577' height='92'> </div> </p></div> <p>We can think of <a href="https://reference.wolfram.com/language/ref/LLMExampleFunction.html"><tt>LLMExampleFunction</tt></a> as a kind of textual analog of <tt><a href="http://reference.wolfram.com/language/ref/Predict.html">Predict</a></tt>. And, like <tt><a href="http://reference.wolfram.com/language/ref/Predict.html">Predict</a></tt>, <a href="https://reference.wolfram.com/language/ref/LLMExampleFunction.html"><tt>LLMExampleFunction</tt></a> can take also examples in an all-inputs &#8594; all-outputs form:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg58_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg58.png' alt='' title='' width='435' height='43'> </div> </p></div> <h2 id="pre-written-prompts-and-the-wolfram-prompt-repository">Pre-written Prompts and the Wolfram Prompt Repository</h2> <p>So far we’ve been talking about creating LLM functions “from scratch”, in effect by explicitly writing out a “prompt” (or, alternatively, giving examples to learn from). But it’s often convenient to use—or at least include—“pre-written” prompts, either ones that you’ve created and stored before, or ones that come from our new <a href="https://resources.wolframcloud.com/PromptRepository/">Wolfram Prompt Repository</a>:</p> <p><img src='https://content.wolfram.com/sites/43/2023/05/sw052223WPR.png' alt='Wolfram Prompt Repository' title='Wolfram Prompt Repository' width='364' height='344'/></p> <p>Other posts in this series will talk in more detail about the Wolfram Prompt Repository—and about how it can be used in things like Chat Notebooks. But here we’re going to talk about how it can be used “programmatically” for LLM functions. </p> <p>The first approach is to use what we call “function prompts”—that are essentially pre-built <a href="https://reference.wolfram.com/language/ref/LLMFunction.html"><tt>LLMFunction</tt></a> objects. There’s a whole section of function prompts in the Prompt Repository. As one example, let’s consider the <tt>"<a href="https://resources.wolframcloud.com/PromptRepository/resources/Emojify/">Emojify</a>"</tt> function prompt. Here’s its page in the Prompt Repository:</p> <p><img src='https://content.wolfram.com/sites/43/2023/05/sw052223emojifyX.png' alt='Emojify page' title='Emojify page' width='506' height='385'/></p> <p>You can take any function prompt and apply it to specific text using <a href="https://reference.wolfram.com/language/ref/LLMResourceFunction.html"><tt>LLMResourceFunction</tt></a>. Here’s what happens with the <tt>"<a href="https://resources.wolframcloud.com/PromptRepository/resources/Emojify/">Emojify</a>"</tt> prompt:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg61_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg61.png' alt='' title='' width='606' height='55'> </div> </p></div> <p>And if you look at the pure result from <a href="https://reference.wolfram.com/language/ref/LLMResourceFunction.html"><tt>LLMResourceFunction</tt></a>, we can see that it’s just an <a href="https://reference.wolfram.com/language/ref/LLMFunction.html"><tt>LLMFunction</tt></a>—whose content was obtained from the Prompt Repository: </p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg62_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg62B.png' alt='' title='' width='276' height='82'> </div> </p></div> <p>Here’s another example: </p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg63_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg63.png' alt='' title='' width='670' height='46'> </div> </p></div> <p>And here we’re applying two different (but, in this particular case, approximately inverse) LLM functions from the Prompt Repository: </p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg64_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg64.png' alt='' title='' width='391' height='94'> </div> </p></div> <p><a href="https://reference.wolfram.com/language/ref/LLMResourceFunction.html"><tt>LLMResourceFunction</tt></a> can take more than one argument:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg65A_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/w052223Aimg65B.png' alt='' title='' width='532' height='120'> </div> </p></div> <p>Something that we see here is that <a href="https://reference.wolfram.com/language/ref/LLMResourceFunction.html"><tt>LLMResourceFunction</tt></a> can have an interpreter built into it—so that instead of just returning a string, it can return a computable (<a href="https://reference.wolfram.com/language/ref/interpreter/HeldExpression.html">here held</a>) Wolfram Language expression. So, for example, the <tt>"<a href="https://resources.wolframcloud.com/PromptRepository/resources/MovieSuggest">MovieSuggest</a>"</tt> prompt in the Prompt Repository is defined to include an interpreter that gives <tt>"<a href="https://reference.wolfram.com/language/ref/entity/Movie.html">Movie</a>"</tt> entities</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Ximg1_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Ximg1.png' alt='' title='' width='624' height='100'> </div> </p></div> <p>from which we can do further computations, like:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Ximg2_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Ximg2.png' alt='' title='' width='609' height='330'> </div> </p></div> <p>Besides “function prompts”, another large section of the Prompt Repository is devoted to “persona” prompts. These are primarily intended for chats (“talk to a particular persona”), but they can also be used “programmatically” through <a href="https://reference.wolfram.com/language/ref/LLMResourceFunction.html"><tt>LLMResourceFunction</tt></a> to ask for a single response “from the persona” to a particular input: </p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg66_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg66.png' alt='' title='' width='596' height='69'> </div> </p></div> <p>Beyond function and persona prompts, there’s a third major kind of prompt—that we call a “modifier prompt”—that’s intended to modify output from the LLM. An example of a modifier prompt is <tt>"<a href="https://resources.wolframcloud.com/PromptRepository/resources/ELI5/">ELI5</a>"</tt> (“Explain Like I’m 5”). To “pull in” such a modifier prompt from the Prompt Repository, we use the general function <a href="https://reference.wolfram.com/language/ref/LLMPrompt.html"><tt>LLMPrompt</tt></a>. </p> <p>Say we’ve got an <a href="https://reference.wolfram.com/language/ref/LLMFunction.html"><tt>LLMFunction</tt></a> set up: </p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg67_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg67.png' alt='' title='' width='490' height='70'> </div> </p></div> <p>To modify it with <tt>"<a href="https://resources.wolframcloud.com/PromptRepository/resources/ELI5/">ELI5</a>"</tt>, we just insert <tt><a href="https://reference.wolfram.com/language/ref/LLMPrompt.html"><tt>LLMPrompt</tt></a>["ELI5"]</tt> into the “body” of the <a href="https://reference.wolfram.com/language/ref/LLMFunction.html"><tt>LLMFunction</tt></a>:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg68_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg68.png' alt='' title='' width='597' height='70'> </div> </p></div> <p>You can include multiple modifier prompts; some modifier prompts (like <tt>"Translated"</tt>) are set up to “take parameters” (here, the language to have the output translated into):</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg69_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg69.png' alt='' title='' width='643' height='94'> </div> </p></div> <p>We’ll talk later in more detail about how this works. But the basic idea is just that <a href="https://reference.wolfram.com/language/ref/LLMPrompt.html"><tt>LLMPrompt</tt></a> retrieves representations of prompts from the Prompt Repository: </p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg70_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/w052223Aimg70B.png' alt='' title='' width='300' height='84'> </div> </p></div> <p>An important kind of modifier prompts are ones intended to force the output from an <a href="https://reference.wolfram.com/language/ref/LLMFunction.html"><tt>LLMFunction</tt></a> to have a particular structure, that for example can readily be interpreted in computable Wolfram Language form. Here we’re using the <tt>"<a href="https://resources.wolframcloud.com/PromptRepository/resources/YesNo/">YesNo</a>"</tt> prompt, that forces a yes-or-no answer: </p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg71_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg71.png' alt='' title='' width='519' height='45'> </div> </p></div> <p>By the way, you can also use the <tt>"<a href="https://resources.wolframcloud.com/PromptRepository/resources/YesNo/">YesNo</a>"</tt> prompt as a function prompt:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg72_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg72.png' alt='' title='' width='425' height='43'> </div> </p></div> <p>And in general, as we’ll discuss later, there’s actually lots of crossover between what we’ve called “function”, “persona” and “modifier” prompts.</p> <p>The Wolfram Prompt Repository is intended to have lots of good, useful prompts in it, and to provide a curated, public collection of prompts. But sometimes you’ll want your own, custom prompts—that you might want to share, either publicly or with a specific group. And—just as with the <a href="https://resources.wolframcloud.com/FunctionRepository">Wolfram Function Repository</a>, <a href="https://datarepository.wolframcloud.com/" target="_blank" rel="noopener">Wolfram Data Repository</a>, etc.—you can use exactly the same underlying machinery as the Wolfram Prompt Repository to do this. </p> <p>Start by bringing up a new Prompt Resource Definition notebook (use the <span class="computer-voice">New</span> > <span class="computer-voice">Repository Item</span> > <span class="computer-voice">Prompt Repository Item</span> menu item). Then fill this out with whatever definition you want to give:</p> <p><img src='https://content.wolfram.com/sites/43/2023/05/wolfify.png' alt='Wolfify definition notebook' title='Wolfify definition notebook' width='600' height='374'/></p> <p>There’s a button to submit your definition to the public Prompt Repository. But instead of using this, you can go to the <span class="computer-voice">Deploy</span> menu, which lets you deploy your definition either locally, or publicly or privately <a href="https://www.wolframcloud.com/">to the cloud</a> (or just within the current Wolfram Language session).</p> <p>Let’s say you deploy publicly to the cloud. Then you’ll get a “documentation” webpage:</p> <p><img src='https://content.wolfram.com/sites/43/2023/05/wolfdoc.png' alt='Wolfify documentatin page' title='Wolfify documentation page' width='485' height='344'/></p> <p>And to use your prompt, anyone just has to give its URL:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg75B_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg75A.png' alt='' title='' width='578' height='95'> </div> </p></div> <p><a href="https://reference.wolfram.com/language/ref/LLMPrompt.html"><tt>LLMPrompt</tt></a> gives you a representation of the prompt you wrote:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg76C_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg76A-1.png' alt='' title='' width='630' height='28'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg76B.png' alt='' title='' width='300' height='54'></div> </p></div> <h2 id="how-it-all-works">How It All Works</h2> <p>We’ve seen how <a href="https://reference.wolfram.com/language/ref/LLMFunction.html"><tt>LLMFunction</tt></a>, <a href="https://reference.wolfram.com/language/ref/LLMPrompt.html"><tt>LLMPrompt</tt></a>, etc. can be used. But now let’s talk about how they work at an underlying Wolfram Language level. Like everything else in Wolfram Language, <a href="https://reference.wolfram.com/language/ref/LLMFunction.html"><tt>LLMFunction</tt></a>, <a href="https://reference.wolfram.com/language/ref/LLMPrompt.html"><tt>LLMPrompt</tt></a>, etc. are symbolic objects. Here’s a simple <a href="https://reference.wolfram.com/language/ref/LLMFunction.html"><tt>LLMFunction</tt></a>:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223upwardimg1_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223upwardimg1.png' alt='' title='' width='317' height='84'> </div> </p></div> <p>And when we apply the <a href="https://reference.wolfram.com/language/ref/LLMFunction.html"><tt>LLMFunction</tt></a>, we’re taking this symbolic object and supplying some argument to it—and then it’s evaluating to give a result:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223upwardimg2_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223upwardimg2.png' alt='' title='' width='441' height='81'> </div> </p></div> <p>But what’s actually going on underneath? There are two basic steps. First a piece of text is created. And then this text is fed to the LLM—which generates the result which is returned. So how is the text created? Essentially it’s through the application of a standard <a href="https://reference.wolfram.com/language/ref/StringTemplate.html">Wolfram Language string template</a>:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg80_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg80.png' alt='' title='' width='395' height='46'> </div> </p></div> <p>And then comes the “big step”—processing this text through the LLM. And this is achieved by <a href="https://reference.wolfram.com/language/ref/LLMSynthesize.html"><tt>LLMSynthesize</tt></a>:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg81_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg81.png' alt='' title='' width='339' height='45'> </div> </p></div> <p><a href="https://reference.wolfram.com/language/ref/LLMSynthesize.html"><tt>LLMSynthesize</tt></a> is the function that ultimately underlies all our LLM functionality. Its goal is to do <a href="https://writings.stephenwolfram.com/2023/02/what-is-chatgpt-doing-and-why-does-it-work/#its-just-adding-one-word-at-a-time">what LLMs fundamentally do</a>—which is to take a piece of text and “continue it in a reasonable way”. Here’s a very simple example:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg82_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg82.png' alt='' title='' width='306' height='43'> </div> </p></div> <p>When you do something like ask a question, <a href="https://reference.wolfram.com/language/ref/LLMSynthesize.html"><tt>LLMSynthesize</tt></a> will “continue” by answering it, potentially with another sentence:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg83_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg83.png' alt='' title='' width='433' height='45'> </div> </p></div> <p>There are lots of details, that we’ll talk about later. But we’ve now seen the basic setup, at least for generating textual output. But another important piece is being able to “interpret” the textual output as a computable Wolfram Language expression that can immediately plug into all the other capabilities of the Wolfram Language. The way this interpretation is specified is again very straightforward: you just give a second argument to the <a href="https://reference.wolfram.com/language/ref/LLMFunction.html"><tt>LLMFunction</tt></a>.</p> <p>If that second argument is, say, <tt>f</tt>, the result you’ll get just has <tt>f</tt> applied to the textual output:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg84_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg84.png' alt='' title='' width='390' height='45'> </div> </p></div> <p>But what’s actually going on is that <tt><a href="http://reference.wolfram.com/language/ref/Interpreter.html">Interpreter</a></tt><tt>[f]1</tt> is being applied, which for the symbol <tt>f</tt> happens to be the same as just applying <tt>f</tt>. But in general <tt><a href="http://reference.wolfram.com/language/ref/Interpreter.html">Interpreter</a></tt> is what provides access to the powerful <a href="https://www.wolfram.com/natural-language-understanding/">natural language understanding capabilities</a> of the Wolfram Language—that allow you to convert from pure text to computable Wolfram Language expressions. Here are a few examples of <tt><a href="http://reference.wolfram.com/language/ref/Interpreter.html">Interpreter</a></tt> in action:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg85_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg85.png' alt='' title='' width='251' height='45'> </div> </p></div> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg86_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg86.png' alt='' title='' width='441' height='57'> </div> </p></div> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg87_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg87.png' alt='' title='' width='551' height='59'> </div> </p></div> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg88_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg88.png' alt='' title='' width='405' height='45'> </div> </p></div> <p>So now, by including a <tt>"Color"</tt> interpreter, we can make <a href="https://reference.wolfram.com/language/ref/LLMFunction.html"><tt>LLMFunction</tt></a> return an actual symbolic color specification:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg89_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg89.png' alt='' title='' width='395' height='45'> </div> </p></div> <p>Here’s an example where we’re telling the LLM to write <a href="https://reference.wolfram.com/language/ref/format/JSON.html">JSON, then interpreting it</a>:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg90_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg90.png' alt='' title='' width='702' height='69'> </div> </p></div> <p>A lot of the operation of <a href="https://reference.wolfram.com/language/ref/LLMFunction.html"><tt>LLMFunction</tt></a> “comes for free” from the way <a href="https://www.wolfram.com/language/elementary-introduction/3rd-ed/42-string-patterns-and-templates.html">string templates work in the Wolfram Language</a>. For example, the “slots” in a string template can be sequential</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg91_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg91.png' alt='' title='' width='554' height='46'> </div> </p></div> <p>or can be explicitly numbered:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg92_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg92.png' alt='' title='' width='572' height='46'> </div> </p></div> <p>And this works in <a href="https://reference.wolfram.com/language/ref/LLMFunction.html"><tt>LLMFunction</tt></a> too:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg93_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg93.png' alt='' title='' width='553' height='45'> </div> </p></div> <p>You can name the slots in a string template (or <a href="https://reference.wolfram.com/language/ref/LLMFunction.html"><tt>LLMFunction</tt></a>), and fill in their values from an association:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg94_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg94.png' alt='' title='' width='557' height='69'> </div> </p></div> <p>If you leave out a “slot value”, <tt><a href="http://reference.wolfram.com/language/ref/StringTemplate.html">StringTemplate</a></tt> will by default just leave a blank:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg95_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg95.png' alt='' title='' width='494' height='46'> </div> </p></div> <p>String templates are pretty flexible things, not least because they’re really just special cases of <a href="https://reference.wolfram.com/language/ref/TemplateObject.html">general symbolic template objects</a>:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg96_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg96X.png' alt='' title='' width='354' height='86'> </div> </p></div> <p>What is an <a href="https://reference.wolfram.com/language/ref/LLMExampleFunction.html"><tt>LLMExampleFunction</tt></a>? It’s actually just a special case of <a href="https://reference.wolfram.com/language/ref/LLMFunction.html"><tt>LLMFunction</tt></a>, in which the “template” is constructed from the “input-output” pairs you specify:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg97_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg97C.png' alt='' title='' width='352' height='239'> </div> </p></div> <p>An important feature of <a href="https://reference.wolfram.com/language/ref/LLMFunction.html"><tt>LLMFunction</tt></a> is that it lets you give lists of prompts, that are combined:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg98_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg98.png' alt='' title='' width='624' height='45'> </div> </p></div> <p>And now we’re ready to talk about <a href="https://reference.wolfram.com/language/ref/LLMPrompt.html"><tt>LLMPrompt</tt></a>. The ultimate goal of <a href="https://reference.wolfram.com/language/ref/LLMPrompt.html"><tt>LLMPrompt</tt></a> is to retrieve pre-written prompts and then derive from them text that can be “spliced into” <a href="https://reference.wolfram.com/language/ref/LLMSynthesize.html"><tt>LLMSynthesize</tt></a>. Sometimes prompts (say in the <a href="https://resources.wolframcloud.com/PromptRepository/">Wolfram Prompt Repository</a>) could just be pure pieces of text. But sometimes they need parameters. And for consistency, all prompts from the Prompt Repository are given in the form of template objects. </p> <p>If there are no parameters, here’s how you can extract the pure text form of an <a href="https://reference.wolfram.com/language/ref/LLMPrompt.html"><tt>LLMPrompt</tt></a>:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg99_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg99.png' alt='' title='' width='397' height='45'> </div> </p></div> <p><a href="https://reference.wolfram.com/language/ref/LLMSynthesize.html"><tt>LLMSynthesize</tt></a> effectively automatically resolves any <a href="https://reference.wolfram.com/language/ref/LLMPrompt.html"><tt>LLMPrompt</tt></a> templates given in it, so for example this immediately works:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg100_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg100.png' alt='' title='' width='495' height='70'> </div> </p></div> <p>And it’s this same mechanism that lets one include <a href="https://reference.wolfram.com/language/ref/LLMPrompt.html"><tt>LLMPrompt</tt></a> objects inside <a href="https://reference.wolfram.com/language/ref/LLMFunction.html"><tt>LLMFunction</tt></a>, etc. </p> <p>By the way, there’s always a “core template” in any <a href="https://reference.wolfram.com/language/ref/LLMFunction.html"><tt>LLMFunction</tt></a>. And one way to extract that is just to apply <a href="https://reference.wolfram.com/language/ref/LLMPrompt.html"><tt>LLMPrompt</tt></a> to <a href="https://reference.wolfram.com/language/ref/LLMFunction.html"><tt>LLMFunction</tt></a>:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg101_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg101B.png' alt='' title='' width='361' height='85'> </div> </p></div> <p>It’s also possible to get this using <tt><a href="http://reference.wolfram.com/language/ref/Information.html">Information</a></tt>:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg102_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg102C.png' alt='' title='' width='455' height='85'> </div> </p></div> <p>When you include (possibly several) modifier prompts in <a href="https://reference.wolfram.com/language/ref/LLMSynthesize.html"><tt>LLMSynthesize</tt></a>, <a href="https://reference.wolfram.com/language/ref/LLMFunction.html"><tt>LLMFunction</tt></a>, etc. what you’re effectively doing is “composing” prompts. When the prompts don’t have parameters this is straightforward, and you can just give all the prompts you want directly in a list.</p> <p>But when prompts have parameters, things are a bit more complicated. Here’s an example that uses two prompts, one of which has a parameter:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg103_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg103.png' alt='' title='' width='588' height='115'> </div> </p></div> <p>And the point is that by using <tt><a href="http://reference.wolfram.com/language/ref/TemplateSlot.html">TemplateSlot</a></tt> we can “pull in” arguments from the “outer” <a href="https://reference.wolfram.com/language/ref/LLMFunction.html"><tt>LLMFunction</tt></a>, and use them to explicitly fill arguments we need for an <a href="https://reference.wolfram.com/language/ref/LLMPrompt.html"><tt>LLMPrompt</tt></a> inside. And of course it’s very convenient that we can use general Wolfram Language <tt><a href="http://reference.wolfram.com/language/ref/TemplateObject.html">TemplateObject</a></tt> technology to specify all this “plumbing”.</p> <p>But there’s actually even more that <tt><a href="http://reference.wolfram.com/language/ref/TemplateObject.html">TemplateObject</a></tt> technology gives us. One issue is that in order to feed something to an LLM (or, at least, a present-day one), it has to be an ordinary text string. Yet it’s often convenient to give general Wolfram Language expression arguments to LLM functions. Inside <tt><a href="http://reference.wolfram.com/language/ref/StringTemplate.html">StringTemplate</a></tt> (and <a href="https://reference.wolfram.com/language/ref/LLMFunction.html"><tt>LLMFunction</tt></a>) there’s an <tt><a href="http://reference.wolfram.com/language/ref/InsertionFunction.html">InsertionFunction</a></tt> option, that specifies how things are supposed to be converted for insertion—and the default for that is to use the function <tt><a href="http://reference.wolfram.com/language/ref/TextString.html">TextString</a></tt>, which tries to make “reasonable textual versions” of any Wolfram Language expression.</p> <p>So this is why something like this can work:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg104_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg104.png' alt='' title='' width='373' height='46'> </div> </p></div> <p>It&#8217;s because applying the <tt><a href="https://reference.wolfram.com/language/ref/StringTemplate.html">StringTemplate</a></tt> turns the <img style="margin-bottom: -2px" loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223pinkbox.png' alt='' title='' width='15' height='15'> expression into a string (in this case <tt><a href="https://reference.wolfram.com/language/ref/RGBColor.html">RGBColor</a>[</tt>&#8230;<tt>]</tt>) that the LLM can process.</p> <p>It’s always possible to specify your own <tt><a href="http://reference.wolfram.com/language/ref/InsertionFunction.html">InsertionFunction</a></tt>. For example, here’s an <tt><a href="http://reference.wolfram.com/language/ref/InsertionFunction.html">InsertionFunction</a></tt> that “reads an image” by using <tt><a href="http://reference.wolfram.com/language/ref/ImageIdentify.html">ImageIdentify</a></tt> to find what’s in it:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg105_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg105A.png' alt='' title='' width='576' height='159'> </div> </p></div> <h2 id="what-about-the-llm-inside">What about the LLM Inside?</h2> <p><a href="https://reference.wolfram.com/language/ref/LLMFunction.html"><tt>LLMFunction</tt></a> etc. “package up” LLM functionality so that it can be used as an integrated part of the Wolfram Language. But what about the LLM inside? What specifies how it’s set up? </p> <p>The key is to think of it as being what we’re calling an “LLM evaluator”. In using Wolfram Language the default is to evaluate expressions (like 2 + 2) using the standard Wolfram Language evaluator. Of course, there are functions like <tt><a href="http://reference.wolfram.com/language/ref/CloudEvaluate.html">CloudEvaluate</a></tt> and <tt><a href="http://reference.wolfram.com/language/ref/RemoteEvaluate.html">RemoteEvaluate</a></tt>—as well as <tt><a href="http://reference.wolfram.com/language/ref/ExternalEvaluate.html">ExternalEvaluate</a></tt>—that do evaluation”elsewhere”. And it’s basically the same story for LLM functions. Except that now the “evaluator” is an LLM, and “evaluation” means running the LLM, ultimately in effect using <a href="https://reference.wolfram.com/language/ref/LLMSynthesize.html"><tt>LLMSynthesize</tt></a>.</p> <p>And the point is that you can specify what LLM—with what configuration—should be used by setting the <a href="https://reference.wolfram.com/language/ref/LLMEvaluator.html"><tt>LLMEvaluator</tt></a> option for <a href="https://reference.wolfram.com/language/ref/LLMSynthesize.html"><tt>LLMSynthesize</tt></a>, <a href="https://reference.wolfram.com/language/ref/LLMFunction.html"><tt>LLMFunction</tt></a>, etc. You can also give a default by setting the global value of <a href="https://reference.wolfram.com/language/ref/$LLMEvaluator.html"><tt>$LLMEvaluator</tt></a>.</p> <p>Two basic choices of underlying model right now are <tt>"<a href="https://platform.openai.com/docs/models/gpt-3-5" target="_blank">GPT-3.5-Turbo</a>"</tt>, <tt>"<a href="https://platform.openai.com/docs/models/gpt-4" target="_blank">GPT-4</a>"</tt> (as well as <a href="https://platform.openai.com/docs/models" target="_blank">other OpenAI models</a>)—and there’ll be more in the future. You can specify which of these you want to use in the setting for <a href="https://reference.wolfram.com/language/ref/LLMEvaluator.html"><tt>LLMEvaluator</tt></a>:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg106_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg106.png' alt='' title='' width='498' height='70'> </div> </p></div> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg107_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg107.png' alt='' title='' width='498' height='68'> </div> </p></div> <p>When you “use a model” you’re (at least for now) calling an API—that needs authentication, etc. And that is handled either through <span class="computer-voice">Preferences</span> settings, or programmatically through <tt><a href="http://reference.wolfram.com/language/ref/ServiceConnect.html">ServiceConnect</a></tt><tt>—</tt>with help from <tt><a href="http://reference.wolfram.com/language/ref/SystemCredential.html">SystemCredential</a></tt>, <tt><a href="http://reference.wolfram.com/language/ref/Environment.html">Environment</a></tt>, etc.</p> <p>Once you’ve specified the underlying model, another thing you’ll often want to specify is a list of initial prompts (which, technically, are inserted as <tt>"System"</tt>-role prompts):</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg108_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg108.png' alt='' title='' width='670' height='70'> </div> </p></div> <p>In another post we’ll discuss the very powerful concept of adding tools to an LLM evaluator—which allow it to call on Wolfram Language functionality during its operation. There are various options to support this. One is <tt>"StopTokens"</tt>—a list of tokens which, if encountered, should cause the LLM to stop generating output, here at the “ff” in the word “giraffe”:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg109_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg109.png' alt='' title='' width='411' height='70'> </div> </p></div> <p><tt>LLMConfiguration</tt> lets you specify a full “symbolic LLM configuration” that precisely defines what LLM, with what configuration, you want to use:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg110_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg110.png' alt='' title='' width='594' height='103'> </div> </p></div> <p>There’s one particularly important further aspect of LLM configurations to discuss, and that’s the question of how much randomness the LLM should use. The most common way to specify this is through the <tt>"Temperature"</tt> parameter. Recall that at each step in its operation an <a href="https://writings.stephenwolfram.com/2023/02/what-is-chatgpt-doing-and-why-does-it-work/#its-just-adding-one-word-at-a-time">LLM generates a list of probabilities</a> for what the next token in its output should be. The <tt>"Temperature"</tt> parameter <a href="https://writings.stephenwolfram.com/2023/02/what-is-chatgpt-doing-and-why-does-it-work/#its-just-adding-one-word-at-a-time">determines how to actually generate a token</a> based on those probabilities.</p> <p>Temperature 0 always “deterministically” picks the token that is deemed most probable. Nonzero temperatures explicitly introduce randomness. Temperature 1 picks tokens according to the actual probabilities generated by the LLM. Lower temperatures favor words that were assigned higher probabilities; higher temperature “reach further” to words with lower probabilities.</p> <p>Lower temperatures generally lead to “flatter” but more reliable and reproducible results; higher temperatures introduce more “liveliness”, but also more of a tendency to “go off track”.</p> <p>Here’s what happens at zero temperature (yes, a very “flat” joke):</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg111_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg111.png' alt='' title='' width='579' height='45'> </div> </p></div> <p>Now here’s temperature 1:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg112_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg112.png' alt='' title='' width='579' height='45'> </div> </p></div> <p>There’s always randomness at temperature 1, so the result will typically be different every time:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg113_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg113.png' alt='' title='' width='579' height='66'> </div> </p></div> <p>If you increase the temperature too much, the LLM will start “melting down”, and producing nonsense:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg114_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg114.png' alt='' title='' width='592' height='66'> </div> </p></div> <p>At temperature 2 (the current maximum) the LLM has effectively gone completely bonkers, dredging up all sorts of weird stuff from its “subconscious”:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg115_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/llmsynthesize.png' alt='' title='' width='620' height='252'> </div> </p></div> <p>In this case, it goes on for a long time, but finally hits a stop token and stops. But often at higher temperatures you’ll have to explicitly specify the <tt><a href="http://reference.wolfram.com/language/ref/MaxItems.html">MaxItems</a></tt> option for <a href="https://reference.wolfram.com/language/ref/LLMSynthesize.html"><tt>LLMSynthesize</tt></a>, so you cut off the LLM after a given number of tokens—and don’t let it “randomly wander” forever.</p> <p>Now here comes a subtlety. While by default <a href="https://reference.wolfram.com/language/ref/LLMFunction.html"><tt>LLMFunction</tt></a> uses temperature 0, <a href="https://reference.wolfram.com/language/ref/LLMSynthesize.html"><tt>LLMSynthesize</tt></a> instead uses temperature 1. And this nonzero temperature means that <a href="https://reference.wolfram.com/language/ref/LLMSynthesize.html"><tt>LLMSynthesize</tt></a> will by default typically generate different results every time it’s used:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg116_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg116.png' alt='' title='' width='320' height='45'> </div> </p></div> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg117_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg117.png' alt='' title='' width='556' height='45'> </div> </p></div> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg118_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg118.png' alt='' title='' width='539' height='45'> </div> </p></div> <p>So what about <a href="https://reference.wolfram.com/language/ref/LLMFunction.html"><tt>LLMFunction</tt></a>? It’s set up to be by default as “deterministic” and repeatable as possible. But for subtle and detailed reasons it can’t be perfectly deterministic and repeatable, at least with typical current implementations of LLM neural nets. </p> <p>The basic issue is that current neural nets <a href="https://writings.stephenwolfram.com/2023/02/what-is-chatgpt-doing-and-why-does-it-work/#neural-nets">operate with approximate real numbers</a>, and occasionally roundoff in those numbers can be critical to “decisions” made by the neural net (typically because the application of the activation function for the neural net can lead to a bifurcation between results from numerically nearby values). And so, for example, if different <a href="https://reference.wolfram.com/language/ref/LLMFunction.html"><tt>LLMFunction</tt></a> evaluations happen on servers with different hardware and different roundoff characteristics, the results can be different.</p> <p>But actually the results can be different even if exactly the same hardware is used. Here’s the typical (subtle) reason why. In a neural net evaluation there are lots of arithmetic operations that can in principle be done in parallel. And if one’s using a GPU there’ll be units that can in principle do certain numbers of these operations in parallel. But there’s typically elaborate <a href="https://docs.nvidia.com/cuda/archive/11.8.0/floating-point/index.html" target="_blank" rel="noopener">real-time optimization of what operation should be done when</a>—that depends, for example, on the detailed state and history of the GPU. But so what? Well, it means that in different cases operations can end up being done in different orders. So, for example, one time one might end up computing (<em>a</em> + <em>b</em>) + <em>c</em>, while another time one might compute <em>a</em> + (<em>b</em> + <em>c</em>).</p> <p>Now, of course, in standard mathematics, for ordinary numbers <em>a</em>, <em>b</em> and <em>c</em>, these forms are always identically equal. But with limited-precision floating-point numbers on a computer, they sometimes aren’t, as in a case like this:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg119_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg119.png' alt='' title='' width='313' height='46'> </div> </p></div> <p>And the presence of even this tiny deviation from associativity (normally only in the least significant bit) means that the order of operations in a GPU can in principle matter. At the level of individual operations, it’s a small effect. But if one “hits a bifurcation” in the neural net, there can end up being a cascade of consequences, leading eventually to a different token being produced, and a whole different “path of text” being generated—all even though one is “operating at zero temperature”. </p> <p>Most of the time this is quite a nuisance—because it means you can’t count on an <a href="https://reference.wolfram.com/language/ref/LLMFunction.html"><tt>LLMFunction</tt></a> doing the same thing every time it’s run. But sometimes you’ll specifically want an <a href="https://reference.wolfram.com/language/ref/LLMFunction.html"><tt>LLMFunction</tt></a> to be a bit random and “creative”—which is something you can force by explicitly telling it to use a nonzero temperature. So, for example, with default zero temperature, this will usually give the same result each time:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg120_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg120.png' alt='' title='' width='556' height='46'> </div> </p></div> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg121_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg121.png' alt='' title='' width='556' height='46'> </div> </p></div> <p>But with temperature 1, you’ll get different results each time (though the LLM really seems to like Sally!):</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg122_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg122.png' alt='' title='' width='484' height='94'> </div> </p></div> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg123_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg123.png' alt='' title='' width='459' height='70'> </div> </p></div> <h2 id="ai-wrangling-and-the-art-of-prompts">AI Wrangling and the Art of Prompts</h2> <p>There’s a certain systematic and predictable character to writing typical Wolfram Language. You use functions that have been carefully designed (with <a href="https://livestreams.stephenwolfram.com/category/live-ceoing/" target="_blank" rel="noopener">great effort</a>, over decades, I might add) to do particular, well-specified and documented things. But setting up prompts for LLMs is a much less systematic and predictable activity. It’s more of an art—where one’s effectively probing the “alien mind” of the LLM, and trying to “wrangle” it to do what one wants.</p> <p>I’ve come to believe, though, that the #1 thing about good prompts is that they have to be based on good expository writing. The same things that make a piece of writing understandable to a human will make it “understandable” to the LLM. And in a sense that’s not surprising, given that the LLM is trained in a very “human way”—from human-written text. </p> <p>Consider the following prompt:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg124_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg124.png' alt='' title='' width='374' height='45'> </div> </p></div> <p>In this case it does what one probably wants. But it’s a bit sloppy. What does “reverse” mean? Here it interprets it quite differently (as character string reversal):</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg125_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg125.png' alt='' title='' width='333' height='46'> </div> </p></div> <p>Better wording might be:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg126_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg126.png' alt='' title='' width='382' height='45'> </div> </p></div> <p>But one feature of an LLM is that whatever input you give, it’ll always give some output. It’s not really clear what the “opposite” of a fish is—but the LLM offers an opinion:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg127_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg127.png' alt='' title='' width='327' height='45'> </div> </p></div> <p>But whereas in the cases above the <a href="https://reference.wolfram.com/language/ref/LLMFunction.html"><tt>LLMFunction</tt></a> just gave single-word outputs, here it’s now giving a whole explanatory sentence. And one of the typical challenges of <a href="https://reference.wolfram.com/language/ref/LLMFunction.html"><tt>LLMFunction</tt></a> prompts is trying to be sure that they give results that stay in the same format. Quite often telling the LLM what format one wants will work (yes, it’s a slightly dubious “opposite”, but not completely crazy):</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg128_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg128.png' alt='' title='' width='524' height='44'> </div> </p></div> <p>Here we’re trying to constrain the output more—which in this case worked, though the actual result was different:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg129_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg129.png' alt='' title='' width='606' height='92'> </div> </p></div> <p>It’s often useful to give the LLM examples of what you want the output to be like (the <tt>\n</tt> newline helps separate parts of the prompt):</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg130_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg130.png' alt='' title='' width='543' height='44'> </div> </p></div> <p>But even when you think you know what’s going to happen, the LLM can sometimes surprise you. This finds phonetic renditions of words in different forms of English: </p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg131_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg131.png' alt='' title='' width='531' height='45'> </div> </p></div> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg132_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg132.png' alt='' title='' width='550' height='45'> </div> </p></div> <p>So far, consistent formats. But now look at this (!):</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg133_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg133.png' alt='' title='' width='510' height='46'> </div> </p></div> <p>If you give an interpretation function inside <a href="https://reference.wolfram.com/language/ref/LLMFunction.html"><tt>LLMFunction</tt></a>, this can often in effect “clean up” the raw text generated by the LLM. But again things can go wrong. Here’s an example where many of the colors were successfully interpreted, but one didn’t make it:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg134_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg134.png' alt='' title='' width='650' height='106'> </div> </p></div> <p>(The offending “color” is “neon”, which is really more like a class of colors.)</p> <p>By the way, the general form of the result we just got is somewhat remarkable, and characteristic of an interesting capability of LLMs—effectively their ability to do “linguistic statistics” of the web, etc. Most likely the LLM never specifically saw in its training data a table of “most fashionable colors”. But it saw lots of text about colors and fashions, that mentioned particular years. If it had collected numerical data, it could have used standard mathematical and statistical methods to combine it, look for “favorites”, etc. But instead it’s dealing with linguistic data, and the point is that the way an LLM works, it’s in effect able to systematically handle and combine that data, and derive “aggregated conclusions” from it.</p> <h2 id="symbolic-chats">Symbolic Chats</h2> <p>In <a href="https://reference.wolfram.com/language/ref/LLMFunction.html"><tt>LLMFunction</tt></a>, etc. the underlying LLM is basically always called just once. But in a chatbot like <a href="https://chat.openai.com/" target="_blank" rel="noopener">ChatGPT</a> things are different: there the goal is to build up a chat, with the LLM being called repeatedly, as things go back and forth with a (typically human) “chat partner”. And along with the release of <a href="https://reference.wolfram.com/language/ref/LLMFunction.html"><tt>LLMFunction</tt></a>, etc. we’re also releasing a symbolic framework for “LLM chats”.</p> <p>A chat is always represented by a chat object. This creates an “empty chat”:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg135_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg135C.png' alt='' title='' width='195' height='80'> </div> </p></div> <p>Now we can take the empty chat, and “make our first statement”, to which the LLM will respond:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg136_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg136.png' alt='' title='' width='545' height='148'> </div> </p></div> <p>We can add another back and forth:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg137_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg137.png' alt='' title='' width='678' height='313'> </div> </p></div> <p>At each stage the <a href="https://reference.wolfram.com/language/ref/ChatObject.html"><tt>ChatObject</tt></a> represents the complete state of the chat so far. So it’s easy for us to go back to a given state, and “go on differently” from there:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg138_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg138.png' alt='' title='' width='678' height='314'> </div> </p></div> <p>What’s inside a <a href="https://reference.wolfram.com/language/ref/ChatObject.html"><tt>ChatObject</tt></a>? Here’s the basic structure:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg139_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg139A.png' alt='' title='' width='721' height='228'> </div> </p></div> <p>The “roles” are defined by the underlying LLM; in this case they’re “User” (i.e. content provided by the user) and “Assistant” (i.e. content generated automatically by the LLM).</p> <p>When an LLM generates new output in chat, it’s always reading everything that came before in the chat. <a href="https://reference.wolfram.com/language/ref/ChatObject.html"><tt>ChatObject</tt></a> has a convenient way to find out how big a chat has got:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg140_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg140.png' alt='' title='' width='155' height='57'> </div> </p></div> <p><a href="https://reference.wolfram.com/language/ref/ChatObject.html"><tt>ChatObject</tt></a> typically displays as a chat history. But you can create a <a href="https://reference.wolfram.com/language/ref/ChatObject.html"><tt>ChatObject</tt></a> by giving the explicit messages you want to appear in the initial chat—here based on one part of the history above—and then run <tt>ChatEvaluate</tt> starting from that:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg141_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg141.png' alt='' title='' width='678' height='553'> </div> </p></div> <p>What if you want to have the LLM “adopt a particular persona”? Well, you can do that by giving an initial (<tt>"System"</tt>) prompt, say from the <a href="https://resources.wolframcloud.com/PromptRepository/">Wolfram Prompt Repository</a>, as part of an <a href="https://reference.wolfram.com/language/ref/LLMEvaluator.html"><tt>LLMEvaluator</tt></a> specification:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223yodaimg1_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223yodaimg1.png' alt='' title='' width='678' height='362'> </div> </p></div> <p>Having chats in symbolic form makes it possible to build and manipulate them programmatically. Here’s a small program that effectively has the AI “interrogate itself”, automatically switching back and forth being the “User” and “Assistant” sides of the conversation:</p> <div> <div class='wolfram-c2c-wrapper writtings-c2c_above' data-c2c-file='https://content.wolfram.com/sites/43/2023/05/sw052223Aimg143_copy.txt' data-c2c-type='text/html'> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223interrogation1.png' alt='' title='' width='550' height='216'> </br> <img loading='lazy' src='https://content.wolfram.com/sites/43/2023/05/sw052223interrogation2A.png' alt='' title='' width='675' height='482'></div> </p></div> <h2 id="this-is-just-the-beginning">This Is Just the Beginning&#8230;</h2> <p>There’s a lot that can be done with all the new functionality we’ve discussed here. But actually it’s just part of what we’ve been able to develop by combining our longtime tower of technology with newly available LLM capabilities. I’ll be describing more in subsequent posts.</p> <p>But what we’ve seen here is essentially the “call an LLM from within Wolfram Language” side of things. In the future, we’ll discuss how Wolfram Language tools can be called from within an LLM—opening up very powerful multi-pass automatic “collaboration” between LLMs and Wolfram Language. We’ll also in the future discuss how a new kind of Wolfram Notebooks can be used to provide a uniquely effective interactive interface to LLMs. And there’ll be much more too. Indeed, almost every day we’re uncovering remarkable new possibilities. </p> <p>But <a href="https://reference.wolfram.com/language/ref/LLMFunction.html"><tt>LLMFunction</tt></a> and the other things we’ve discussed here form an important foundation for what we can now do. Extending what we’ve done over the past decade or more in machine learning, they form a key bridge between the symbolic world that’s at the core of the Wolfram Language, and the “statistical AI” world of LLMs. It’s a uniquely powerful combination that we can expect to represent an anchor piece of what can now be done.</p> </div> <div class="post_foot single"> <div class="category"> <div class="citingsOuterWrapper"> <div class="citingsInnerWrapper"> <button type="button" class="citingsOpenButton"> <span class="citingsOpenButtonText">Cite this as</span> </button> <button type="button" class="citingsCloseButton"> <div class="citingsCloseButtonIcon"></div> </button><span class="citingClosedPlainText citingText wolfram-c2c-wrapper" data-C2C-Inline="Stephen Wolfram (2023), &quot;The New World of LLM Functions: Integrating LLM Technology into the Wolfram Language,&quot; Stephen Wolfram Writings. writings.stephenwolfram.com/2023/05/the-new-world-of-llm-functions-integrating-llm-technology-into-the-wolfram-language." data-C2C-type="text/plain">Stephen Wolfram (2023), &quot;The New World of LLM Functions: Integrating LLM Technology into the Wolfram Language,&quot; Stephen Wolfram Writings. writings.stephenwolfram.com/2023/05/the-new-world-of-llm-functions-integrating-llm-technology-into-the-wolfram-language.</span><div class="citing"><div class="citingType">Text</div><div class="citingText wolfram-c2c-wrapper" data-C2C-Inline="Stephen Wolfram (2023), &quot;The New World of LLM Functions: Integrating LLM Technology into the Wolfram Language,&quot; Stephen Wolfram Writings. writings.stephenwolfram.com/2023/05/the-new-world-of-llm-functions-integrating-llm-technology-into-the-wolfram-language." data-C2C-type="text/plain">Stephen Wolfram (2023), &quot;The New World of LLM Functions: Integrating LLM Technology into the Wolfram Language,&quot; Stephen Wolfram Writings. writings.stephenwolfram.com/2023/05/the-new-world-of-llm-functions-integrating-llm-technology-into-the-wolfram-language.</div></div><div class="citing"><div class="citingType">CMS</div><div class="citingText wolfram-c2c-wrapper" data-C2C-Inline="Wolfram, Stephen. &quot;The New World of LLM Functions: Integrating LLM Technology into the Wolfram Language.&quot; Stephen Wolfram Writings. May 23, 2023. writings.stephenwolfram.com/2023/05/the-new-world-of-llm-functions-integrating-llm-technology-into-the-wolfram-language." data-C2C-type="text/plain">Wolfram, Stephen. &quot;The New World of LLM Functions: Integrating LLM Technology into the Wolfram Language.&quot; Stephen Wolfram Writings. May 23, 2023. writings.stephenwolfram.com/2023/05/the-new-world-of-llm-functions-integrating-llm-technology-into-the-wolfram-language.</div></div><div class="citing"><div class="citingType">APA</div><div class="citingText wolfram-c2c-wrapper" data-C2C-Inline="Wolfram, S. (2023, May 23). The new world of LLM functions: Integrating LLM technology into the Wolfram Language. Stephen Wolfram Writings. writings.stephenwolfram.com/2023/05/the-new-world-of-llm-functions-integrating-llm-technology-into-the-wolfram-language." data-C2C-type="text/plain">Wolfram, S. (2023, May 23). The new world of LLM functions: Integrating LLM technology into the Wolfram Language. Stephen Wolfram Writings. writings.stephenwolfram.com/2023/05/the-new-world-of-llm-functions-integrating-llm-technology-into-the-wolfram-language.</div></div> </div> <div class="citingsShowSpacer"></div></div> <p>Posted in: <a href="https://writings.stephenwolfram.com/category/artificial-intelligence/" rel="category tag">Artificial Intelligence</a>, <a href="https://writings.stephenwolfram.com/category/mathematica/" rel="category tag">Mathematica</a>, <a href="https://writings.stephenwolfram.com/category/new-technology/" rel="category tag">New Technology</a>, <a href="https://writings.stephenwolfram.com/category/software-design/" rel="category tag">Software Design</a>, <a href="https://writings.stephenwolfram.com/category/wolfram-language/" rel="category tag">Wolfram Language</a></p> </div> </div> <div id="comments_wrapper"> <span id="comments"></span> <div id="respond"> <!-- <h3 class="comments-heading"><div class="cancel-comment-reply"><a rel="nofollow" id="cancel-comment-reply-link" href="/2023/05/the-new-world-of-llm-functions-integrating-llm-technology-into-the-wolfram-language/#respond" style="display:none;">cancel [x]</a></div></h3> --> <div id="join-small"> <input type="text" id="fakeComment" placeholder="Join the discussion"> </div> <form action="https://writings.stephenwolfram.com/wp-comments-post.php" method="post" id="commentform"> <div id="join-big"> <div id="exit-button"><div id="exit-image"></div><div style="clear: both;"></div></div> <div id="comment-area"> <textarea name="comment" id="comment" tabindex="1"></textarea> <p><span id="commentError" style="display:none">Please enter your comment (at least 5 characters).</span></p> </div> <div class="level"> <div class="half-length"><label for="author">Name (required)</label></div> <div class="half-length "><div class="pad-left"><label for="email">Email (will not be published; required)</label></div></div> <div style="clear:both;"></div> </div> <div> <div class="half-length"><input type="text" name="author" id="author" value="" size="22" tabindex="2" aria-required='true' /><p><span id="nameError" style="display:none">Please enter your name.</span></p></div> <div class="half-length "><div class="pad-left"><input type="text" name="email" id="email" value="" size="22" tabindex="3" aria-required='true' /></div> <p><span id="emailError" style="margin-left: 10px; display:none">Please&nbsp;enter&nbsp;a&nbsp;valid&nbsp;email&nbsp;address.</span></p></div> <div style="clear:both;"></div> </div> <div class="level"> <div class="half-length"><label for="url">Website</label></div> <div style="clear:both;"></div> <div class="half-length"><input type="text" name="url" id="url" value="" size="22" tabindex="4" /></div> <div style="clear:both;"></div> <p><input name="submit" type="submit" id="submit" class="button" tabindex="5" value="Submit comment &raquo;" onclick="return checkCommentFields()" /></p> <div style="clear:both;"></div> </div> <div class="post_separator_no_margin"></div> </div> <input type='hidden' name='comment_post_ID' value='49776' id='comment_post_ID' /> <input type='hidden' name='comment_parent' id='comment_parent' value='0' /> <p style="display: none;"><input type="hidden" id="akismet_comment_nonce" name="akismet_comment_nonce" value="e7a170f027" /></p><p style="display: none;"><input type="hidden" id="ak_js" name="ak_js" value="248"/></p> </form> </div><!-- respond --> </div><!-- wrapper --> <script type="text/javascript"> function checkCommentFields() { if($(".socialLoggedIn").is(":visible")) return true; var ret = true; if($("#author").val().trim().length < 2) { $("#nameError").fadeIn(); ret = false; } else { $("#nameError").fadeOut(); } if(!validEmail($("#email").val().trim())) { $("#emailError").fadeIn(); ret = false; } else { $("#emailError").fadeOut(); } if($("#comment").val().trim().length < 5) { $("#commentError").fadeIn(); ret = false; } else { $("#commentError").fadeOut(); } return ret; } $(document).ready(function(){ $('.comment-author a').attr("target", "_blank"); if(window.location.href.indexOf("comment-page-1") > -1) { $('#comment-section').removeClass('hide'); } $("#author").keyup(function() { if($("#nameError").is(":visible") && $("#author").val().trim().length >= 2) $("#nameError").fadeOut(); }); $("#email").keyup(function() { if($("#emailError").is(":visible") && validEmail($("#email").val().trim())) $("#emailError").fadeOut(); }); $("#comment").keyup(function() { if($("#commentError").is(":visible") && $("#comment").val().trim().length >= 5) $("#commentError").fadeOut(); }); }); function validEmail(email) { signPos = email.indexOf("@"); dotPos = email.lastIndexOf("."); if (email.length < 6 || signPos == -1 || dotPos == -1 || (dotPos < signPos) || (dotPos - signPos == 1) || dotPos == email.length-1 ) { return false; } return true; } </script> <div id="footer_recent_posts"> <p class="sidebar-heading">Related Writings</p> <div class="sidebar_post_wrapper"> <div class="sidebar_thumbnail"> <a href="https://writings.stephenwolfram.com/2024/08/whats-really-going-on-in-machine-learning-some-minimal-models/" rel="bookmark" title="Permanent Link to What&#8217;s Really Going On in Machine Learning? Some Minimal Models" > <img width="128" height="108" src="https://content.wolfram.com/sites/43/2024/08/swblog-ml-icon-v2.png" class="lazy wp-post-image" alt="" title="" /> </a> </div> <div class="sidebar_post"> <p><a href="https://writings.stephenwolfram.com/2024/08/whats-really-going-on-in-machine-learning-some-minimal-models/" rel="bookmark" title="Permanent Link to What&#8217;s Really Going On in Machine Learning? Some Minimal Models" >What&#8217;s Really Going On in Machine Learning? Some Minimal Models</a></p> <p><time datetime="2024-08-22">August 22, 2024</time></p> </div> </div> <div class="sidebar_post_wrapper"> <div class="sidebar_thumbnail"> <a href="https://writings.stephenwolfram.com/2024/07/yet-more-new-ideas-and-new-functions-launching-version-14-1-of-wolfram-language-mathematica/" rel="bookmark" title="Permanent Link to Yet More New Ideas and New Functions: Launching Version 14.1 of Wolfram Language &#038; Mathematica" > <img width="128" height="108" src="https://content.wolfram.com/sites/43/2024/07/swblog-v14.1-icon.png" class="lazy wp-post-image" alt="" title="" /> </a> </div> <div class="sidebar_post"> <p><a href="https://writings.stephenwolfram.com/2024/07/yet-more-new-ideas-and-new-functions-launching-version-14-1-of-wolfram-language-mathematica/" rel="bookmark" title="Permanent Link to Yet More New Ideas and New Functions: Launching Version 14.1 of Wolfram Language &#038; Mathematica" >Yet More New Ideas and New Functions: Launching Version 14.1 of Wolfram Language &#038; Mathematica</a></p> <p><time datetime="2024-07-31">July 31, 2024</time></p> </div> </div> <div class="sidebar_post_wrapper"> <div class="sidebar_thumbnail"> <a href="https://writings.stephenwolfram.com/2024/05/why-does-biological-evolution-work-a-minimal-model-for-biological-evolution-and-other-adaptive-processes/" rel="bookmark" title="Permanent Link to Why Does Biological Evolution Work? A Minimal Model for Biological Evolution and Other Adaptive Processes" > <img width="128" height="108" src="https://content.wolfram.com/sites/43/2024/05/bioevo-tile-1.png" class="lazy wp-post-image" alt="" title="" /> </a> </div> <div class="sidebar_post"> <p><a href="https://writings.stephenwolfram.com/2024/05/why-does-biological-evolution-work-a-minimal-model-for-biological-evolution-and-other-adaptive-processes/" rel="bookmark" title="Permanent Link to Why Does Biological Evolution Work? A Minimal Model for Biological Evolution and Other Adaptive Processes" >Why Does Biological Evolution Work? A Minimal Model for Biological Evolution and Other Adaptive Processes</a></p> <p><time datetime="2024-05-03">May 3, 2024</time></p> </div> </div> <div class="sidebar_post_wrapper"> <div class="sidebar_thumbnail"> <a href="https://writings.stephenwolfram.com/2024/03/can-ai-solve-science/" rel="bookmark" title="Permanent Link to Can AI Solve Science?" > <img width="128" height="108" src="https://content.wolfram.com/sites/43/2024/03/ai-solve-science-v2.png" class="lazy wp-post-image" alt="" title="" /> </a> </div> <div class="sidebar_post"> <p><a href="https://writings.stephenwolfram.com/2024/03/can-ai-solve-science/" rel="bookmark" title="Permanent Link to Can AI Solve Science?" >Can AI Solve Science?</a></p> <p><time datetime="2024-03-05">March 5, 2024</time></p> </div> </div> </div> </article> </div> <div id="sidebar"> <form class="headerSearchBox" method="get" action="https://writings.stephenwolfram.com/" id="search"> <input class="searchboxsub" type="text" value="" name="s" id="query_1" placeholder="Search Writings" /> <input type="submit" class="headerSearchSubmit" value="" title="Search"> </form> <div class="sidebar-pod related-writings"></div> <div class="sidebar-pod recent-writings"> <p class="sidebar-heading">Recent Writings</p> <div class="sidebar-inner"> <div id="postContainer"> <div class="sidebar_post_wrapper"> <div class="sidebar_thumbnail"><a href="https://writings.stephenwolfram.com/2024/10/on-the-nature-of-time/" rel="bookmark" title="Permanent Link to On the Nature of Time" ><img src="https://content.wolfram.com/sites/43/2024/10/swblog-time-icon-v2.png" alt=""></a></div> <div class="sidebar_post"> <p><a href="https://writings.stephenwolfram.com/2024/10/on-the-nature-of-time/" rel="bookmark" title="Permanent Link to On the Nature of Time" >On the Nature of Time</a></p> <p><time datetime="2024-10-08">October 8, 2024</time></p> </div> </div> <div class="sidebar_post_wrapper"> <div class="sidebar_thumbnail"><a href="https://writings.stephenwolfram.com/2024/09/nestedly-recursive-functions/" rel="bookmark" title="Permanent Link to Nestedly Recursive Functions" ><img src="https://content.wolfram.com/sites/43/2024/09/swblog-recursive-icon.png" alt=""></a></div> <div class="sidebar_post"> <p><a href="https://writings.stephenwolfram.com/2024/09/nestedly-recursive-functions/" rel="bookmark" title="Permanent Link to Nestedly Recursive Functions" >Nestedly Recursive Functions</a></p> <p><time datetime="2024-09-27">September 27, 2024</time></p> </div> </div> <div class="sidebar_post_wrapper"> <div class="sidebar_thumbnail"><a href="https://writings.stephenwolfram.com/2024/08/five-most-productive-years-what-happened-and-whats-next/" rel="bookmark" title="Permanent Link to Five Most Productive Years: What Happened and What&#8217;s Next" ><img src="https://content.wolfram.com/sites/43/2024/08/swblog-5years-icon.png" alt=""></a></div> <div class="sidebar_post"> <p><a href="https://writings.stephenwolfram.com/2024/08/five-most-productive-years-what-happened-and-whats-next/" rel="bookmark" title="Permanent Link to Five Most Productive Years: What Happened and What&#8217;s Next" >Five Most Productive Years: What Happened and What&#8217;s Next</a></p> <p><time datetime="2024-08-29">August 29, 2024</time></p> </div> </div> <div class="sidebar_post_wrapper"> <div class="sidebar_thumbnail"><a href="https://writings.stephenwolfram.com/2024/08/whats-really-going-on-in-machine-learning-some-minimal-models/" rel="bookmark" title="Permanent Link to What&#8217;s Really Going On in Machine Learning? Some Minimal Models" ><img src="https://content.wolfram.com/sites/43/2024/08/swblog-ml-icon-v2.png" alt=""></a></div> <div class="sidebar_post"> <p><a href="https://writings.stephenwolfram.com/2024/08/whats-really-going-on-in-machine-learning-some-minimal-models/" rel="bookmark" title="Permanent Link to What&#8217;s Really Going On in Machine Learning? Some Minimal Models" >What&#8217;s Really Going On in Machine Learning? Some Minimal Models</a></p> <p><time datetime="2024-08-22">August 22, 2024</time></p> </div> </div> <div class="sidebar_post_wrapper"> <div class="sidebar_thumbnail"><a href="https://writings.stephenwolfram.com/2024/07/yet-more-new-ideas-and-new-functions-launching-version-14-1-of-wolfram-language-mathematica/" rel="bookmark" title="Permanent Link to Yet More New Ideas and New Functions: Launching Version 14.1 of Wolfram Language &#038; Mathematica" ><img src="https://content.wolfram.com/sites/43/2024/07/swblog-v14.1-icon.png" alt=""></a></div> <div class="sidebar_post"> <p><a href="https://writings.stephenwolfram.com/2024/07/yet-more-new-ideas-and-new-functions-launching-version-14-1-of-wolfram-language-mathematica/" rel="bookmark" title="Permanent Link to Yet More New Ideas and New Functions: Launching Version 14.1 of Wolfram Language &#038; Mathematica" >Yet More New Ideas and New Functions: Launching Version 14.1 of Wolfram Language &#038; Mathematica</a></p> <p><time datetime="2024-07-31">July 31, 2024</time></p> </div> </div> </div> </div> <a href="/all-by-date" class="all-by-date chevron-after">All by date</a> </div> <div class="sidebar-pod popular-categories"> <p class="sidebar-heading">Popular Categories</p> <div class="categories-list-row sidebar-inner"> <ul class="categories-list"> <li><a href="/category/artificial-intelligence">Artificial Intelligence</a></li><li><a href="/category/big-picture">Big Picture</a></li><li><a href="/category/companies-and-business">Companies &amp; Business</a></li><li><a href="/category/computational-science">Computational Science</a></li><li><a href="/category/computational-thinking">Computational Thinking</a></li><li><a href="/category/data-science">Data Science</a></li><li><a href="/category/education">Education</a></li><li><a href="/category/future-perspectives">Future Perspectives</a></li><li><a href="/category/historical-perspectives">Historical Perspectives</a></li><li><a href="/category/language-and-communication">Language &amp; Communication</a></li><li><a href="/category/life-and-times">Life &amp; Times</a></li><li><a href="/category/life-science">Life Science</a></li><li><a href="/category/mathematica">Mathematica</a></li><li><a href="/category/mathematics">Mathematics</a></li><li><a href="/category/new-kind-of-science">New Kind of Science</a></li><li><a href="/category/new-technology">New Technology</a></li><li><a href="/category/personal-analytics">Personal Analytics</a></li><li><a href="/category/philosophy">Philosophy</a></li><li><a href="/category/physics">Physics</a></li><li><a href="/category/ruliology">Ruliology</a></li><li><a href="/category/software-design">Software Design</a></li><li><a href="/category/wolfram-alpha">Wolfram|Alpha</a></li><li><a href="/category/wolfram-language">Wolfram Language</a></li><li><a href="/category/other">Other</a></li> </ul> </div> </div> <div class="sidebar-pod writings-by-year"> <p class="sidebar-heading">Writings by Year</p> <div class="sidebar-archive sidebar-inner"> <ul> <li><a href="/all-by-date/#2024">2024</a></li><li><a href="/all-by-date/#2023">2023</a></li><li><a href="/all-by-date/#2022">2022</a></li><li><a href="/all-by-date/#2021">2021</a></li><li><a href="/all-by-date/#2020">2020</a></li><li><a href="/all-by-date/#2019">2019</a></li><li><a href="/all-by-date/#2018">2018</a></li><li><a href="/all-by-date/#2017">2017</a></li><li><a href="/all-by-date/#2016">2016</a></li><li><a href="/all-by-date/#2015">2015</a></li><li><a href="/all-by-date/#2014">2014</a></li><li><a href="/all-by-date/#2013">2013</a></li><li><a href="/all-by-date/#2012">2012</a></li><li><a href="/all-by-date/#2011">2011</a></li><li><a href="/all-by-date/#2010">2010</a></li><li><a href="/all-by-date/#2009">2009</a></li><li><a href="/all-by-date/#2008">2008</a></li><li><a href="/all-by-date/#2007">2007</a></li><li><a href="/all-by-date/#2006">2006</a></li><li><a href="/all-by-date/#2004">2004</a></li><li><a href="/all-by-date/#2003">2003</a></li> <li><a href="/all-by-date/">All</a></li> </ul> </div> </div> <span id="side-images"> <a href="https://www.amazon.com/dp/1579550495"><img src="https://content.wolfram.com/sites/43/2023/04/book-nks-20th.png" width="254" height="" alt=""/></a> </span> </div> </div><!-- end of "inner" --> <footer id="footer"> <div class="inner"> © Stephen Wolfram, LLC <span class="footer-sep">|</span> Open content: <a href="//creativecommons.org/licenses/by-sa/4.0/" target="_blank"> <svg id="icon-cc-by-sa" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 110 32"> <g transform="translate(76 0)"> <path d="M15.7,0.9c4.2,0,7.7,1.5,10.7,4.4c2.9,2.9,4.4,6.4,4.4,10.6c0,4.2-1.4,7.7-4.3,10.6c-3,3-6.6,4.4-10.7,4.4 c-4.1,0-7.6-1.5-10.6-4.4C2.2,23.5,0.7,20,0.7,15.9c0-4.1,1.5-7.6,4.4-10.6C8.1,2.3,11.6,0.9,15.7,0.9z M15.8,3.6 c-3.4,0-6.3,1.2-8.7,3.6c-2.4,2.5-3.7,5.4-3.7,8.7c0,3.3,1.2,6.2,3.6,8.6c2.4,2.4,5.3,3.6,8.7,3.6c3.3,0,6.2-1.2,8.7-3.7 c2.4-2.3,3.5-5.2,3.5-8.6c0-3.4-1.2-6.3-3.6-8.7C22.1,4.8,19.2,3.6,15.8,3.6z M9.1,13.8c0.3-1.8,1-3.3,2.2-4.3 c1.2-1,2.7-1.5,4.4-1.5c2.4,0,4.2,0.8,5.6,2.3s2.1,3.5,2.1,5.8c0,2.3-0.7,4.2-2.2,5.7c-1.4,1.5-3.3,2.3-5.6,2.3 c-1.7,0-3.2-0.5-4.4-1.5c-1.2-1-2-2.5-2.2-4.3h3.8c0.1,1.8,1.2,2.7,3.3,2.7c1.1,0,1.9-0.5,2.5-1.4c0.6-0.9,1-2.1,1-3.6 c0-1.6-0.3-2.8-0.9-3.6c-0.6-0.8-1.4-1.2-2.5-1.2c-2,0-3.1,0.9-3.4,2.7h1.1l-3,3l-3-3L9.1,13.8L9.1,13.8z" fill="currentColor"></path> </g> <g transform="translate(5 0)"> <path d="M59.4,5.2c-2.9-2.9-6.4-4.3-10.7-4.3c-4.1,0-7.7,1.4-10.6,4.3c-2.9,3-4.4,6.6-4.4,10.7s1.5,7.6,4.4,10.6 c3,2.9,6.5,4.4,10.6,4.4c4.1,0,7.7-1.5,10.7-4.5c2.9-2.8,4.3-6.3,4.3-10.5C63.7,11.7,62.3,8.1,59.4,5.2z M57.5,24.5 c-2.5,2.4-5.4,3.7-8.7,3.7c-3.4,0-6.2-1.2-8.7-3.6c-2.4-2.4-3.6-5.3-3.6-8.6c0-3.3,1.2-6.2,3.7-8.7c2.4-2.4,5.2-3.6,8.7-3.6 c3.4,0,6.3,1.2,8.7,3.6c2.4,2.4,3.6,5.3,3.6,8.7C61.1,19.3,59.9,22.2,57.5,24.5z" fill="currentColor"></path> <path d="M46.7,8.3c0-1.4,0.7-2.1,2.1-2.1s2.1,0.7,2.1,2.1c0,1.4-0.7,2.1-2.1,2.1C47.3,10.4,46.7,9.7,46.7,8.3z" fill="currentColor"></path> <path d="M52.8,18.3h-1.7v7.3h-4.7v-7.3h-1.7c0,0,0-4.1,0-6.1c0-0.6,0.4-1,1-1c2,0,4,0,6,0c0.6,0,1,0.4,1,1 C52.8,14.2,52.8,18.3,52.8,18.3z" fill="currentColor"></path> </g> <g id="cc-logo"> <path d="M15.7,0.9c4.2,0,7.8,1.5,10.7,4.4c1.4,1.4,2.5,3,3.2,4.8c0.7,1.8,1.1,3.7,1.1,5.8c0,2.1-0.4,4-1.1,5.8 c-0.7,1.8-1.8,3.4-3.2,4.8c-1.4,1.4-3.1,2.6-5,3.3c-1.8,0.8-3.8,1.2-5.8,1.2c-2,0-3.9-0.4-5.7-1.1c-1.8-0.8-3.5-1.9-4.9-3.3 c-1.4-1.4-2.5-3.1-3.3-4.9c-0.8-1.8-1.1-3.7-1.1-5.7c0-2,0.4-3.9,1.1-5.7c0.8-1.8,1.9-3.5,3.3-4.9C8,2.3,11.6,0.9,15.7,0.9z M15.8,3.6c-3.4,0-6.3,1.2-8.7,3.6C6,8.3,5,9.7,4.4,11.2c-0.6,1.5-1,3.1-0.9,4.7c0,1.6,0.3,3.2,0.9,4.6C5,22,6,23.4,7.1,24.5 c1.1,1.1,2.5,2.1,4,2.7c1.5,0.6,3,0.9,4.7,0.9c1.6,0,3.2-0.3,4.7-0.9c1.5-0.6,2.9-1.6,4.1-2.7c2.3-2.3,3.5-5.2,3.5-8.6 c0-1.7-0.3-3.2-0.9-4.7c-0.6-1.5-1.5-2.8-2.7-4C22.1,4.8,19.2,3.6,15.8,3.6z M15.6,13.4l-2,1c-0.2-0.4-0.5-0.8-0.8-0.9 c-0.3-0.2-0.6-0.3-0.9-0.3c-1.3,0-2,0.9-2,2.7c0,0.8,0.2,1.4,0.5,1.9c0.3,0.5,0.8,0.7,1.5,0.7c0.9,0,1.5-0.4,1.9-1.3l1.8,0.9 c-0.4,0.7-0.9,1.3-1.6,1.7c-0.7,0.4-1.5,0.6-2.3,0.6c-1.3,0-2.4-0.4-3.2-1.2c-0.8-0.8-1.2-2-1.2-3.4c0-1.4,0.4-2.6,1.2-3.4 c0.8-0.8,1.9-1.3,3.1-1.3C13.4,11.2,14.8,11.9,15.6,13.4L15.6,13.4z M24.2,13.4l-2,1c-0.2-0.4-0.5-0.8-0.8-0.9 c-0.3-0.2-0.6-0.3-0.9-0.3c-1.3,0-2,0.9-2,2.7c0,0.8,0.2,1.4,0.5,1.9c0.3,0.5,0.8,0.7,1.5,0.7c0.9,0,1.5-0.4,1.8-1.3l1.9,0.9 c-0.4,0.7-1,1.3-1.7,1.7c-0.7,0.4-1.5,0.6-2.3,0.6c-1.4,0-2.4-0.4-3.3-1.2c-0.8-0.8-1.2-2-1.2-3.4c0-1.4,0.4-2.6,1.2-3.4 c0.8-0.8,1.9-1.3,3.1-1.3C22.1,11.2,23.4,11.9,24.2,13.4L24.2,13.4z" fill="currentColor"></path> </g> </svg> </a> (code: <a href="//creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank"> <svg id="icon-cc-by-nc-sa" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 146 32"> <g transform="translate(5 0)"> <path d="M59.4,5.2C56.5,2.3,53,0.9,48.7,0.9c-4.1,0-7.7,1.4-10.6,4.3c-2.9,3-4.4,6.6-4.4,10.7s1.5,7.6,4.4,10.6 c3,2.9,6.5,4.4,10.6,4.4s7.7-1.5,10.7-4.5c2.9-2.8,4.3-6.3,4.3-10.5C63.7,11.7,62.3,8.1,59.4,5.2z M57.5,24.5 c-2.5,2.4-5.4,3.7-8.7,3.7c-3.4,0-6.2-1.2-8.7-3.6c-2.4-2.4-3.6-5.3-3.6-8.6s1.2-6.2,3.7-8.7c2.4-2.4,5.2-3.6,8.7-3.6 c3.4,0,6.3,1.2,8.7,3.6s3.6,5.3,3.6,8.7C61.1,19.3,59.9,22.2,57.5,24.5z" fill="currentColor"></path> <path d="M46.7,8.3c0-1.4,0.7-2.1,2.1-2.1s2.1,0.7,2.1,2.1s-0.7,2.1-2.1,2.1C47.3,10.4,46.7,9.7,46.7,8.3z" fill="currentColor"></path> <path d="M52.8,18.3h-1.7v7.3h-4.7v-7.3h-1.7c0,0,0-4.1,0-6.1c0-0.6,0.4-1,1-1c2,0,4,0,6,0c0.6,0,1,0.4,1,1 C52.8,14.2,52.8,18.3,52.8,18.3z" fill="currentColor"></path> </g> <g transform="translate(76 0)"> <path d="M53.9,0.9c4.2,0,7.7,1.5,10.7,4.4c2.9,2.9,4.4,6.4,4.4,10.6s-1.4,7.7-4.3,10.6c-3,3-6.6,4.4-10.7,4.4s-7.6-1.5-10.6-4.4 c-3-3-4.5-6.5-4.5-10.6s1.5-7.6,4.4-10.6C46.3,2.3,49.8,0.9,53.9,0.9z M54,3.6c-3.4,0-6.3,1.2-8.7,3.6c-2.4,2.5-3.7,5.4-3.7,8.7 s1.2,6.2,3.6,8.6c2.4,2.4,5.3,3.6,8.7,3.6c3.3,0,6.2-1.2,8.7-3.7c2.4-2.3,3.5-5.2,3.5-8.6s-1.2-6.3-3.6-8.7 C60.3,4.8,57.4,3.6,54,3.6z M47.3,13.8c0.3-1.8,1-3.3,2.2-4.3S52.2,8,53.9,8c2.4,0,4.2,0.8,5.6,2.3c1.4,1.5,2.1,3.5,2.1,5.8 s-0.7,4.2-2.2,5.7c-1.4,1.5-3.3,2.3-5.6,2.3c-1.7,0-3.2-0.5-4.4-1.5c-1.2-1-2-2.5-2.2-4.3H51c0.1,1.8,1.2,2.7,3.3,2.7 c1.1,0,1.9-0.5,2.5-1.4c0.6-0.9,1-2.1,1-3.6c0-1.6-0.3-2.8-0.9-3.6c-0.6-0.8-1.4-1.2-2.5-1.2c-2,0-3.1,0.9-3.4,2.7h1.1l-3,3l-3-3 L47.3,13.8L47.3,13.8z" fill="currentColor"></path> </g> <g id="cc-logo"> <path d="M15.7,0.9c4.2,0,7.8,1.5,10.7,4.4c1.4,1.4,2.5,3,3.2,4.8s1.1,3.7,1.1,5.8s-0.4,4-1.1,5.8s-1.8,3.4-3.2,4.8 c-1.4,1.4-3.1,2.6-5,3.3c-1.8,0.8-3.8,1.2-5.8,1.2s-3.9-0.4-5.7-1.1C8.1,29.1,6.4,28,5,26.6s-2.5-3.1-3.3-4.9S0.6,18,0.6,16 s0.4-3.9,1.1-5.7C2.5,8.5,3.6,6.8,5,5.4C8,2.3,11.6,0.9,15.7,0.9z M15.8,3.6c-3.4,0-6.3,1.2-8.7,3.6C6,8.3,5,9.7,4.4,11.2 s-1,3.1-0.9,4.7c0,1.6,0.3,3.2,0.9,4.6C5,22,6,23.4,7.1,24.5s2.5,2.1,4,2.7s3,0.9,4.7,0.9c1.6,0,3.2-0.3,4.7-0.9s2.9-1.6,4.1-2.7 c2.3-2.3,3.5-5.2,3.5-8.6c0-1.7-0.3-3.2-0.9-4.7s-1.5-2.8-2.7-4C22.1,4.8,19.2,3.6,15.8,3.6z M15.6,13.4l-2,1 c-0.2-0.4-0.5-0.8-0.8-0.9c-0.3-0.2-0.6-0.3-0.9-0.3c-1.3,0-2,0.9-2,2.7c0,0.8,0.2,1.4,0.5,1.9s0.8,0.7,1.5,0.7 c0.9,0,1.5-0.4,1.9-1.3l1.8,0.9c-0.4,0.7-0.9,1.3-1.6,1.7c-0.7,0.4-1.5,0.6-2.3,0.6c-1.3,0-2.4-0.4-3.2-1.2c-0.8-0.8-1.2-2-1.2-3.4 s0.4-2.6,1.2-3.4c0.8-0.8,1.9-1.3,3.1-1.3C13.4,11.2,14.8,11.9,15.6,13.4L15.6,13.4z M24.2,13.4l-2,1c-0.2-0.4-0.5-0.8-0.8-0.9 c-0.3-0.2-0.6-0.3-0.9-0.3c-1.3,0-2,0.9-2,2.7c0,0.8,0.2,1.4,0.5,1.9s0.8,0.7,1.5,0.7c0.9,0,1.5-0.4,1.8-1.3l1.9,0.9 c-0.4,0.7-1,1.3-1.7,1.7c-0.7,0.4-1.5,0.6-2.3,0.6c-1.4,0-2.4-0.4-3.3-1.2c-0.8-0.8-1.2-2-1.2-3.4s0.4-2.6,1.2-3.4 c0.8-0.8,1.9-1.3,3.1-1.3C22.1,11.2,23.4,11.9,24.2,13.4L24.2,13.4z" fill="currentColor"></path> </g> <g id="cc-nc"> <path d="M91.7,1c4.2,0,7.8,1.4,10.7,4.3c2.9,2.9,4.4,6.4,4.4,10.7c0,4.2-1.4,7.7-4.3,10.5c-3,3-6.6,4.5-10.7,4.5 c-4.1,0-7.6-1.5-10.6-4.4c-2.9-2.9-4.4-6.5-4.4-10.6c0-4.1,1.5-7.7,4.4-10.7C84.1,2.5,87.6,1,91.7,1z M80.1,12 c-0.4,1.2-0.7,2.6-0.7,4c0,3.3,1.2,6.2,3.6,8.6c2.4,2.4,5.3,3.6,8.7,3.6c3.4,0,6.3-1.2,8.7-3.7c0.9-0.8,1.6-1.7,2.1-2.6l-5.7-2.5 c-0.2,0.9-0.7,1.7-1.4,2.3c-0.8,0.6-1.7,0.9-2.7,1v2.3h-1.7v-2.3c-1.7,0-3.2-0.6-4.6-1.8l2.1-2.1c1,0.9,2.1,1.4,3.3,1.4 c0.5,0,1-0.1,1.3-0.3c0.4-0.2,0.5-0.6,0.5-1.2c0-0.4-0.1-0.7-0.4-0.9l-1.4-0.6l-1.8-0.8l-2.4-1C87.8,15.4,80.1,12,80.1,12z M91.8,3.7c-3.4,0-6.3,1.2-8.7,3.6c-0.6,0.6-1.1,1.3-1.7,2l5.7,2.6c0.2-0.8,0.7-1.4,1.4-1.9c0.7-0.5,1.5-0.7,2.4-0.8V6.9h1.7v2.3 c1.4,0.1,2.6,0.5,3.8,1.4l-2,2c-0.8-0.6-1.7-0.9-2.6-0.9c-0.5,0-0.9,0.1-1.2,0.3c-0.4,0.2-0.6,0.5-0.6,0.9c0,0.1,0,0.2,0.1,0.4 l1.9,0.9l1.3,0.6l2.4,1.1l7.7,3.4c0.2-1.1,0.4-2.1,0.4-3.2c0-3.4-1.2-6.3-3.6-8.7C98.1,4.9,95.2,3.7,91.8,3.7L91.8,3.7z" fill="currentColor"></path> </g> </svg> </a>) <a href="//en.wikipedia.org/wiki/Wikipedia:Citing_sources" target="_blank"> <svg id="icon-wiki" xmlns="http://www.w3.org/2000/svg" viewBox="101 0 44 32"> <g transform="translate(0 0)"> <path id="wikipedia" d="M129.6,4.5l0.3,0h0.5l0.2,0h0.4l0.2,0l0.5,0h0.2l0.1,0.1v0.7c0,0.2-0.1,0.3-0.3,0.3c-1.1,0-1.3,0.2-1.7,0.7 c-0.2,0.3-0.6,1-1.1,1.7l-3.7,7l-0.1,0.2l4.6,9.4l0.3,0.1l7.2-17.1c0.3-0.7,0.2-1.2-0.1-1.5c-0.3-0.3-0.6-0.4-1.4-0.5l-0.7,0 c-0.1,0-0.2,0-0.2-0.1c-0.1,0-0.1-0.1-0.1-0.2V4.6l0.1-0.1h8.1l0.1,0.1v0.7c0,0.2-0.1,0.3-0.3,0.3c-1.1,0-1.9,0.3-2.4,0.7 c-0.5,0.4-0.9,1-1.2,1.7c0,0-2.2,5-4.4,10.1l-0.4,0.9c-1.6,3.6-3.2,7.2-4.1,9.2c-0.9,1.7-1.7,1.5-2.5,0c-0.6-1.2-1.6-3.3-2.5-5.5 l-0.7-1.4c-0.4-0.8-0.8-1.7-1.1-2.4c-1.5,3.2-3.6,7.4-4.7,9.4c-1,1.8-1.8,1.5-2.5,0c-2.3-5.4-7-15-9.3-20.3c-0.4-1-0.7-1.6-1-1.9 c-0.3-0.2-0.9-0.4-1.8-0.4c-0.3,0-0.5-0.1-0.5-0.3V4.6l0.1-0.1l0.8,0h1.4l1.4,0h0.4l2.5,0h0.3l1.3,0h0.8l0.1,0.1v0.7 c0,0.2-0.1,0.3-0.4,0.3l-0.9,0c-0.8,0-1.2,0.3-1.2,0.7c0,0.2,0.1,0.5,0.3,1c1.8,4.3,7.9,17.3,7.9,17.2l0.2,0.1l3.9-7.9 c-0.5-1.1-0.8-1.7-0.8-1.7L119,9.6c0,0-0.5-1.1-0.7-1.4c-1.2-2.4-1.2-2.5-2.4-2.6c-0.3,0-0.5-0.1-0.5-0.3V4.6l0.1-0.1h1l2.1,0h3.9 l0.2,0.1v0.7c0,0.2-0.1,0.3-0.4,0.3l-0.5,0.1c-1.3,0.1-1.1,0.6-0.2,2.3l2.6,5.3l2.9-5.7c0.5-1,0.4-1.3,0.2-1.5l0,0 c-0.1-0.1-0.5-0.4-1.3-0.4l-0.3,0c-0.1,0-0.2,0-0.2-0.1c-0.1,0-0.1-0.1-0.1-0.2V4.6l0.1-0.1l1.2,0H129.6z" fill="currentColor"></path> </g> </svg> </a> <span class="footer-sep">|</span> <a href="/terms" target="_blank">Terms</a> <span class="footer-sep">|</span> <a href="/feed/" target="_blank">RSS</a> </div> </footer></div><!-- end of "outerWrap" --> <script type='text/javascript' src='https://writings.stephenwolfram.com/wp-content/plugins/akismet/_inc/form.js?ver=3.2'></script> <script type='text/javascript' src='https://writings.stephenwolfram.com/wp-includes/js/comment-reply.min.js?ver=4.7.2'></script> <script type='text/javascript' src='https://writings.stephenwolfram.com/wp-includes/js/wp-embed.min.js?ver=4.7.2'></script> <!--noscript.en.html--> <style> #_noscript, #_noscript * { box-sizing: border-box; margin: 0; outline: 0; padding: 0; z-index: 99999999999; } #_noscript { background: #fff6aa; border-bottom: 1px solid #eeca48; bottom: 0; color: #4c4c4c; display: block; font-size: .875rem; font-style: italic; left: 0; min-width: 320px; position: fixed; right: 0; width: 100%; z-index: 99999998 !important; /* place it beneath the global header */ } #_noscript > div { align-items: center; display: grid; gap: .5rem; grid-template-columns: 28px auto; height: 40px; justify-content: center; margin: 0 1rem; } #_noscript svg { display: inline-block; height: 25px; vertical-align: middle; width: 28px; } #_noscript a { color: #222; font-style: normal; text-decoration: none; } #_noscript a:hover { color: #ef621a; } </style> <noscript id="_noscript" class="gl-noscript-standalone remove__ready"> <div> <div><svg class="_noscript-warning"><use href="#_noscript-warning"></use></svg></div> <div>Enable JavaScript to interact with content and submit forms on Wolfram websites. <a href="http://www.enable-javascript.com/" target="_blank" data-walid="GUIFooter">Learn how&nbsp;»</a></div> </div> </noscript> <div style="height: 0; width: 0; position: absolute; visibility: hidden; top: -999999999999px;"> <svg xmlns="http://www.w3.org/2000/svg"> <g id="_noscript-icons"> <symbol id="_noscript-warning" viewBox="0 0 28.21 25"> <path d="M27.91,21.7L16.01,1.1c-.84-1.47-2.96-1.47-3.81,0L.3,21.7c-.85,1.47,.21,3.3,1.9,3.3H26c1.69,0,2.75-1.83,1.91-3.3ZM15.75,7.44l-.46,9.42h-2.37l-.48-9.42h3.31Zm-1.65,14.25c-1.12,0-1.87-.81-1.87-1.89s.77-1.89,1.87-1.89,1.83,.79,1.85,1.89c0,1.08-.73,1.89-1.85,1.89Z" fill="#f47821"/> <polygon points="15.77 7.47 15.31 16.89 12.94 16.89 12.46 7.47 15.77 7.47" fill="#fff"/> <path d="M14.1,21.69c-1.12,0-1.87-.81-1.87-1.89s.77-1.89,1.87-1.89,1.83,.79,1.85,1.89c0,1.08-.73,1.89-1.85,1.89Z" fill="#fff"/> </symbol> </g> </svg> </div> <!--/noscript.en.html--> <script>var baselang = '';</script> <script src="https://writings.stephenwolfram.com/wp-content/themes/sw-writings/clipboard.js"></script> <script src="/common/js/clipboard/2.0/clipboard.js"></script> <script src="/common/js/c2c/1.0/WolframC2C.js"></script> <script src="/common/js/c2c/1.0/WolframC2CGui.js"></script> <script src="/common/js/c2c/1.0/WolframC2CDefault.js"></script> <link rel="stylesheet" href="/common/js/c2c/1.0/WolframC2CGui.css.en"> <script> let c2cWrittings = new WolframC2CDefault({'triggerClass':'writtings-c2c_above', 'uniqueIdPrefix': 'writtings-c2c_above-'}); </script><script type="text/javascript"> if ( location.hash!="" && Number.isInteger( Number( location.hash.substring(1) ) ) ) { var jumplink = Number( location.hash.substring(1) ) - 1; document.getElementsByClassName('InCell')[jumplink].scrollIntoView(true); } </script> <!-- begin framework footer en --> <div id ="IPstripe-wrap"></div> <script src="/common/stripe/stripe.en.js"></script> <script type="application/ld+json"> { "@context": "http://schema.org", "@type": "WebPage", "name": "The New World of LLM Functions: Integrating LLM Technology into the Wolfram Language&mdash;Stephen Wolfram Writings", "description": "How to install and use Wolfram's instant LLM-powered functions. Stephen Wolfram shares dozens of examples and explains how the functions work. Also download "pre-written" prompts from a curated repository.", "url": "https://writings.stephenwolfram.com:443/2023/05/the-new-world-of-llm-functions-integrating-llm-technology-into-the-wolfram-language/", "image": "https://content.wolfram.com/sites/43/2023/05/blog-hero-nestlist-llm-function.png", "inLanguage": "en" } </script> <!-- end framework footer en --> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10