<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Emile on Medium]]></title>
        <description><![CDATA[Stories by Emile on Medium]]></description>
        <link>https://medium.com/@emile1?source=rss-c9774590b74b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*RKtH-YEa7JwKtOwTtVkACg.jpeg</url>
            <title>Stories by Emile on Medium</title>
            <link>https://medium.com/@emile1?source=rss-c9774590b74b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 18:28:56 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@emile1/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Lessons Learnt in the Tech Industry — From Academia to Business]]></title>
            <link>https://medium.com/@emile1/lessons-learnt-in-the-tech-industry-from-academia-to-business-04cfdaba6320?source=rss-c9774590b74b------2</link>
            <guid isPermaLink="false">https://medium.com/p/04cfdaba6320</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[academia]]></category>
            <category><![CDATA[life-lessons]]></category>
            <dc:creator><![CDATA[Emile]]></dc:creator>
            <pubDate>Sat, 09 Nov 2024 13:41:00 GMT</pubDate>
            <atom:updated>2024-11-09T13:41:00.156Z</atom:updated>
            <content:encoded><![CDATA[<h3>Lessons Learnt in the Tech Industry — From Academia to Business</h3><p>A shift in perspective. From theory to practice.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Alt9Y7E-LdRuWkyikWurtg.jpeg" /><figcaption>Image by Flux 1.1-pro</figcaption></figure><p>Now, this might be a bit more of an opinion piece, but I thought it valuable to write nonetheless. The transition from the academic mindset to that of business was a very interesting perspective shift I found myself undergoing. After a few years in the industry and with the experiences of academia still relatively fresh, I wanted to share this perspective having seen both sides of the coin for a little bit.</p><p><em>What are the things that I wish I could have told myself a few years ago?</em></p><p>This is the question I pondered. The crux of my introspection. What are the things that no one told me about industry that I wish someone had? Or perhaps just what are some things that I wish I understood better about the way it all works and the attitudes with which to approach problems? This article will go over some of the more prominent lessons I learnt in the industry as a Machine Learning Engineer.</p><p>These are broad brushstrokes and my subjective opinions in the environments I found myself in, although I do believe they can be applied quite broadly to both academia and enterprise tech industry as a whole.</p><h3>Building for Production</h3><p>Getting something into production is not a focus of the academic mind. The focus when researching is generally proving that the advancement is a valid improvement, pointing out limitations of existing approaches, or showing alternative ways of approaching problems. Once that has been demonstrated the buck stops, the research is published, and people move on, either to building further on it, or to other research.</p><p>The ideology of assignments and examinations further reinforces this thought pattern that once the task is done, we move on. When the model or project was built, that was the end of the story. Little did I realize that this is very much not the end; out in the wild, an entire lifecycle of deployment and maintenance still lay ahead.</p><p>Being on the AI/ML (Artificial Intelligence/Machine Learning) side of things, I will focus in here. When in academia, you do the research, gather the data, build the model. In the real world that model has to sit somewhere and actually do what it was built to do. An entire system has to house that model, manage it, hold its data, version it, account for retraining when data patterns drift/change, and a whole host of other tasks that go along with it. Never mind whatever frontend interacts with the model and allows it to be used in a manner that is meaningful to the use case being pursued. The model needs a family of other things to support it. At the time of writing, MLOps (deploying and taking your model to production) is not exactly a perfectly mapped domain and is constantly evolving and growing. So the industry is also figuring it out.</p><p>All these things are things you don’t think about until you need to, and the academic simply does not need to.</p><h3>Building to Scale</h3><p>One of the biggest things that I learnt is building something that can scale. When I was in academia, this was the absolute last thing on my mind. The obsession with the theory of concepts and the very basic practical implementation of those concepts to show that they can work was front and centre. In the industry, proving that something works is not enough, it needs to work well and it needs to work for a large number of users across a wide range of devices and ecosystems. Furthermore it needs to work in such a way that it can easily be expanded at a later stage by someone else entirely. From the academic side, this is not something that is easily accessible either and as a result, is not something that becomes part of the core requirements of the research project whereas in industry it has to be a first-class citizen.</p><h3>Showing off your Work</h3><p>As boastful as that sounds it is an absolute must. Everyone is completely entrenched in their own things, and keeping quiet in a corner where a pull request and some lines of code in a repository is the only evidence of your work then there is not much progression in store for you. Doing good work in silence is not enough to move upwards. People need to know what you are busy with and what you are working on. This can take the form of demonstration sessions or even something as simple as being passionate and vocal during a code review meeting. Explaining how you got to your solution, the hurdles you had to deal with, the implications of your work and what cool things your code can now allow the project to do. Dare I say that telling people is 40 percent of the job. When the performance reviews and salary discussions come around, no one questions you. “Ah yes, so and so, we know what they did, really helped with this thing and with that thing.” You were going to help them with this and that anyway, the difference now is that they know it was you. Motivation for next positions and increase remuneration become much easier.</p><h3>People</h3><p>The collaborative element of building something and getting it out into the world in a feasible way was something that truly required a different mentality. The sheer scope of some projects make the involvement of multiple teams and a plethora of people an absolute necessity. Again, you go from chipping away at research and basic implementations with a small team, maybe (in academia), to a project team of 60+ people consisting of multiple sub teams, both technical and non-technical, where you have to go talk to Bob in this other team you have never heard of, about this software component you don’t really understand, because its doing something funky with your team’s component, which is affecting another team’s data. The people’s skills required was something that no one talked about. Everyone always says you need people skills but no one is ever specific as to what exactly that will entail.</p><h3>Pace</h3><p>Transitioning from academia to industry is very much like going from sprinting to running a marathon. Depending on your type of work, I think for many, there is no defined end goal. When this project finishes, the next one starts. This is in contrast to the well defined tertiary education semesters with plenty of rest in between. There is always something more to be done. The work does not end, nor will it. One has to realize this early on, otherwise, like me, you will be running at sprint pace in a race that is much longer than 100 meters, which can get quite tiring and could leave you burned wondering how other people do it</p><p>Perhaps this is something that applies much more broadly to the transition from academia to the world of work more so than the tech industry. As I am sure you have heard, it’s all about finding that work-life balance.</p><h3>The Larger Lesson</h3><p>Now do not mistake me, one is not better than another. They are simply different roads in the same country. I think in many ways academia can be seen as the first part of the road and industry as the second.</p><p>Many of these lessons and ideas I have come across overlap into one another’s domain like winding roads, doubling back and crossing over. Perhaps you can see, from my perspective, that it was a mental shift on multiple levels. All subtly related yet uniquely distinct.</p><p>I think the grander lesson to be learnt is to accept that they are two different worlds. To understand that a perspective shift is required to move between them and that an adjustment period will be in order. Allow yourself the space to be able to do so, give yourself the time. Hopefully you are already ahead by having had read this here article.</p><p>If you found this article insightful, give it the good ol’ medium clap up at the top. Thanks for reading.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=04cfdaba6320" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[XTTS-v2: High Quality Generative Text-To-Speech Made Easy]]></title>
            <link>https://medium.com/@emile1/xtts-v2-high-quality-generative-text-to-speech-made-easy-db6c54c9c40a?source=rss-c9774590b74b------2</link>
            <guid isPermaLink="false">https://medium.com/p/db6c54c9c40a</guid>
            <category><![CDATA[text-to-speech]]></category>
            <category><![CDATA[generative-ai-tools]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[nlp]]></category>
            <dc:creator><![CDATA[Emile]]></dc:creator>
            <pubDate>Wed, 24 Jan 2024 21:09:18 GMT</pubDate>
            <atom:updated>2024-01-24T21:09:18.378Z</atom:updated>
            <content:encoded><![CDATA[<p>Free, local, and small — this little model packs a punch.</p><figure><img alt="A frog purchasing a new lillypad at the market — DALLE 3" src="https://cdn-images-1.medium.com/max/1024/1*jf14JbETmt4elrK2FEwCPg.jpeg" /><figcaption>A frog purchasing a new lilly pad at the market — DALLE 3</figcaption></figure><p>The AI text-to-speech (TTS) scene has been somewhat overshadowed by the mass momentum of conventional large language models in the last year or so. The advent of the growth in this field however has brought numerous optimizations and other developments to the rest of what can really now be called the AI Jungle. In one corner of this jungle sits the generative TTS canopy where you can find the frog that is XTTS-v2. In this article we will be looking at spinning up this model locally and running basic inference.</p><h3>Overview</h3><p>XTTS-v2 by Coqui AI is a voice generation model that lets you clone voices into a multitude of languages by using just a mere 6-second audio clip. It is licenced under Coqui AI’s <a href="https://coqui.ai/cpml">Coqui Public Model License 1.0.0</a> which allows for “non-commercial use of a machine learning model and its outputs.”.</p><p>Unfortunately it seems that as of Jan 4, 2024 the company is <a href="https://twitter.com/_josh_meyer_/status/1742522906041635166">shutting down</a>, which is quite sad as it really seemed like they were making some incredible progress in generative TTS. Thankfully the <a href="https://github.com/coqui-ai/TTS">GitHub repository</a> seems to have been relinquished to the open-source community to take further for the time being.</p><p>As per the Hugging face model card the model boasts the following features.</p><ul><li>Support of 17 languages.</li><li>Voice cloning with just a 6-second audio clip.</li><li>Emotion and style transfer by cloning.</li><li>Cross-language voice cloning.</li><li>Multi-lingual speech generation.</li><li>24khz sampling rate.</li></ul><p>As the “v2” part of the name would indicate, this is an iteration on their first model with some major improvements across the board and the inclusion of more supported languages.</p><h3>Technicalities and Architecture</h3><p>The specifics of the architecture of the model are beyond the scope for this article, the high level overview however, is briefly discussed below. Taken directly from <a href="https://erogol.com/2023/09/27/xtts-v1-notes">Coqui AI co-founder’s blog</a> on the topic:</p><p>“XTTS builds upon the recent advancements in autoregressive models, such as Tortoise, Vall-E, and Soundstorm, which are based on language models trained on discrete audio representations. XTTS utilizes a VQ-VAE model to discretize the audio into audio tokens. Subsequently, it employs a GPT model to predict these audio tokens based on the input text and speaker latents. The speaker latents are computed by a stack of self-attention layers. The output of the GPT model is passed on to a decoder model that outputs the audio signal. We employ the Tortoise methodology for XTTS-v1, which combines a diffusion model and UnivNet vocoder. This approach involves using the diffusion model to transform the GPT outputs into spectrogram frames, and then utilizing UnivNet to generate the ultimate audio signal.”</p><p>Check out the in-depth explanation for the nitty-gritty details of how the model has been constructed.</p><h3>Requirements and Prerequisites</h3><p>Before we take a deep dive into the code to get this model up and running there are a few items we will require:</p><ul><li>A graphics card with at least 8GB is recommended. From personal use it does not get close to being that high, but more is always better than less.</li><li>Your flavour of a python environment with the TTS library installed and optionally scipy .</li></ul><pre>pip install TTS scipy</pre><ul><li>Your flavour of IDE. Coqui AI have provided multiple ways to run the model, even utilizing just command line. I recommend a Jupyter notebook just for the ease of experimentation.</li><li>A six second audio clip of a speaking voice you wish to clone. We will use .wav formatted files.</li></ul><h3>The Code</h3><p>Using this model is incredibly easy. There are three ways to use the model, calling the TTS API (locally from the TTS package), using the command line and passing in the relevant arguments, or calling the model directly. In this article we will be doing the latter and simply calling the model directly using the methods and classes provided in the TTS python package.</p><p>First clone the Hugging face repository (make sure git lfs is installed):</p><pre>git clone https://huggingface.co/coqui/XTTS-v2</pre><p>Next we can run our import statements, making sure our python virtual environment is active:</p><pre>from TTS.tts.configs.xtts_config import XttsConfig<br>from TTS.tts.models.xtts import Xtts<br><br>from IPython.display import Audio<br>from scipy.io.wavfile import write</pre><p>Then it is as simple as loading the model configuration, loading the model itself, and moving it all the GPU. Ensure that you are pointing to the correct model folders and configuration files within the cloned hugging face repository.</p><pre>config = XttsConfig()<br>config.load_json(&quot;./XTTS-v2/config.json&quot;)<br>model = Xtts.init_from_config(config)<br>model.load_checkpoint(config, checkpoint_dir=&quot;./XTTS-v2/&quot;)<br>model.cuda()</pre><p>After executing the above you should see a neatly formatted output displaying the architecture of the model and all of its many layers and technical specifications. The model is now ready to run inference. We can now call the model, passing in our text, reference audio, and a few other generation parameters. Only one audio sample is required but here we have used two so that the model can capture the style of the reference audio clips better for a more accurate reproduction.</p><pre>text_to_speak = &quot;We are going to go to the gym now to lift heavy circles.&quot;<br>reference_audios = [&quot;./sample_voice1.wav&quot;,&quot;./sample_voice2.wav&quot;]<br><br>outputs = model.synthesize(<br>    text_to_speak,<br>    config,<br>    speaker_wav=reference_audios,<br>    gpt_cond_len=3,<br>    language=&quot;en&quot;,<br>)</pre><p>Alternatively we can also use the model.inference() to generate the audio which has a different method signature:</p><pre><br>print(&quot;Computing speaker latents...&quot;)<br>gpt_cond_latent, speaker_embedding = model.get_conditioning_latents(audio_path=reference_audios)<br><br>outputs = model.inference(<br>    text=string,<br>    gpt_cond_latent=gpt_cond_latent,<br>    speaker_embedding=speaker_embedding,<br>    language=&quot;en&quot;,<br>    enable_text_splitting=True<br>)</pre><p>In this method call we can also pass in the enable_text_splitting parameter which will split the text into sentences and then run the model individually on each chuck thereby ensuring an infinite input length as the model’s context limit is only 250 characters. This is done at the cost of context between sentences and as such the resulting audio will sound a bit disjointed as it transitions from one sentence to the next. A potential improvement here could be a custom splitting function that decides to split the text into bigger chunks taking into account context length as well as sentence boundaries.</p><p>The generation is complete, we can now simply render the output appropriately.</p><pre>Audio(data=outputs[&#39;wav&#39;], rate=24000)</pre><p>If you are using a notebook this should display a plain audio widget, but you can just as easily save the audio to the file system using the scipy library and play it back with any audio player.</p><pre>output_file_path = f&#39;./outputs/output_audio.wav&#39;<br>write(output_file_path, 24000, outputs[&#39;wav&#39;])</pre><h4>Pointers</h4><ul><li>The higher the quality of the reference audio the higher the quality will be of the generated sample, so before tuning any parameters ensure you are using clean, high quality speech only reference samples.</li><li>Write out numbers and expand acronyms. The quality of those words in the generated sample will be much higher.</li><li>Experiment. Try out different voices with different parameters. Give the docs a read and see how far the model will go.</li></ul><h3>Conclusion</h3><p>The applications of this type of technology really are limitless, from giving large language models voices to providing next generation accessibility features for software and devices. A fast, high quality, fully local, generative text-to-speech model in less than 50 lines of code. The industry is rapidly advancing and the AI jungle is restlessly growing bigger every week. Who knows what one will find tomorrow.</p><h3>Resources</h3><ul><li><a href="https://github.com/coqui-ai/TTS">Coqui AI — Github</a></li><li><a href="https://docs.coqui.ai/en/latest/models/xtts.html#">XTTS Documentation</a></li></ul><p><a href="https://huggingface.co/coqui/XTTS-v2">coqui/XTTS-v2 · Hugging Face</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=db6c54c9c40a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tree of Thoughts (ToT) Prompting: The Basics]]></title>
            <link>https://medium.com/@emile1/tree-of-thought-tot-prompting-simply-explained-dca7e719752?source=rss-c9774590b74b------2</link>
            <guid isPermaLink="false">https://medium.com/p/dca7e719752</guid>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[prompt-engineering]]></category>
            <category><![CDATA[large-language-models]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[chatgpt]]></category>
            <dc:creator><![CDATA[Emile]]></dc:creator>
            <pubDate>Sun, 28 May 2023 13:41:39 GMT</pubDate>
            <atom:updated>2023-05-29T11:47:33.813Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="A jade tree" src="https://cdn-images-1.medium.com/max/1024/1*59irLOcZDqAcetdjRaxf6w.png" /><figcaption>Image generated by DALLE-2 through Microsoft Designer.</figcaption></figure><p>Prompt engineering is an emerging field in the realm of large language models (LLMs), where techniques are being developed to enable these models to surpass anticipated performance metrics and results. Cognitive science concepts are becoming the foundation for new-age prompting techniques as researchers strive to more closely mimic the processes of the human brain, giving these models the ability to solve in-depth, multi-step problems. However, despite these advancements, LLMs still face certain challenges, particularly in tasks that demand exploration, strategic foresight, and other complex thinking processes.</p><p>To address these limitations, a novel prompting technique called Tree of Thoughts (ToT) prompting has been introduced. ToT frames any problem as a search over a tree, where each node is a state representing a partial solution with the input and the sequence of thoughts so far.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/892/1*myvw8RUChe7BRvLi-QU0hw.png" /><figcaption>Figure 1: Comparison of prompting technique structures. (Yao et al, 2023)</figcaption></figure><h3>Process Outline</h3><p>Tree of Thoughts is a paradigm that allows LLMs to explore multiple reasoning paths when solving problems. ToT architecture has four parts:</p><ol><li><strong>Thought decomposition<br></strong>Break down the problem-solving process into smaller thought steps. A thought should be big enough for LLMs to evaluate its usefulness but small enough for them to generate diverse samples.</li><li><strong>Thought generator<br></strong>Generate potential next thoughts for each state in the tree. There are two strategies:<br>a) <strong>Sample</strong> independent thoughts from a CoT (Chain of Thought) prompt, which works well for rich thought spaces like paragraphs.<br>b) <strong>Propose</strong> thoughts sequentially using a “propose prompt”, which works better for constrained thought spaces like single words or lines.</li><li><strong>State evaluator<br></strong>Evaluate the progress made by each state in the tree. This serves as a heuristic for the search algorithm to decide which states to explore further. Two strategies for evaluating states are:<br>a) <strong>Value</strong> each state independently by reasoning about it and generating a scalar value or classification.<br>b. <strong>Vote</strong> across states by comparing different states and voting for the most promising one.</li><li><strong>Search algorithm</strong>: Choose a tree search algorithm to use for exploring the problem space.<br>a) <strong>Breadth-first search (BFS)</strong>: This algorithm maintains a set of the most promising states per step. It’s used for problems where the tree depth is limited, and initial thought steps can be evaluated and pruned to a small set.<br>b) <strong>Depth-first search (DFS)</strong>: This algorithm explores the most promising state first until the final output is reached or the state evaluator deems it impossible to solve the problem from the current state. In the latter case, the subtree is pruned to trade exploration for exploitation. DFS backtracks to the parent state to continue exploration.</li></ol><h3>Example</h3><p>In the paper, the authors use three different problems that state-of-the-art LLMs like GPT-4 struggle with. They then use and apply ToT prompting to these problems to achieve impressively high results (See Figure 3). One of these challenges is called the Game of 24. It is a mathematical reasoning challenge, where the goal is to use 4 numbers and basic arithmetic operations (multiplication, addition, division, and subtraction) to obtain an answer of 24. For example, given input “4 9 10 13”, a solution output could be “(10–4) * (13–9) = 24”. The basics of the process is discussed below and demonstrated by the researchers in Figure 2.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6Ci2hklA6H2pBVrXl1uaaA.png" /><figcaption>Figure 2: Game of 24 task flow. (Yao et al, 2023)</figcaption></figure><p>To kick off the problem-solving process, the propose prompt, from the paper’s Github repository, that would iteratively be called per node of the tree would look something like this:</p><pre>propose_prompt = &#39;&#39;&#39;Input: 2 8 8 14<br>Possible next steps:<br>2 + 8 = 10 (left: 8 10 14)<br>8 / 2 = 4 (left: 4 8 14)<br>14 + 2 = 16 (left: 8 8 16)<br>2 * 8 = 16 (left: 8 14 16)<br>8 - 2 = 6 (left: 6 8 14)<br>14 - 8 = 6 (left: 2 6 8)<br>14 /  2 = 7 (left: 7 8 8)<br>14 - 2 = 12 (left: 8 8 12)<br>Input: {input}<br>Possible next steps:<br>&#39;&#39;&#39;</pre><p>The propose prompt would be called on the four input numbers from which “possible next steps” are produced, extracted and become nodes themselves.</p><p>After each node “thought” generation, the new nodes ( “possible next steps”) are iteratively evaluated to determine how much that specific node contributes to the end solution. Such an evaluation prompt could look something like this:</p><pre>value_prompt = &#39;&#39;&#39;Evaluate if given numbers can reach 24 (sure/likely/impossible)<br>10 14<br>10 + 14 = 24<br>sure<br>11 12<br>11 + 12 = 23<br>12 - 11 = 1<br>11 * 12 = 132<br>11 / 12 = 0.91<br>impossible<br>4 4 10<br>4 + 4 + 10 = 8 + 10 = 18<br>4 * 10 - 4 = 40 - 4 = 36<br>(10 - 4) * 4 = 6 * 4 = 24<br>sure<br>4 9 11<br>9 + 11 + 4 = 20 + 4 = 24<br>sure<br>5 7 8<br>5 + 7 + 8 = 12 + 8 = 20<br>(8 - 5) * 7 = 3 * 7 = 21<br>I cannot obtain 24 now, but numbers are within a reasonable range<br>likely<br>5 6 6<br>5 + 6 + 6 = 17<br>(6 - 5) * 6 = 1 * 6 = 6<br>I cannot obtain 24 now, but numbers are within a reasonable range<br>likely<br>10 10 11<br>10 + 10 + 11 = 31<br>(11 - 10) * 10 = 10<br>10 10 10 are all too big<br>impossible<br>1 3 3<br>1 * 3 * 3 = 9<br>(1 + 3) * 3 = 12<br>1 3 3 are all too small<br>impossible<br>{input}<br>&#39;&#39;&#39;</pre><p>These evaluations are extracted and then the best node is selected, again, depending on selection and evaluation strategy, this process comes down to the specific problem at hand. The entire process repeats until a node presents a solution that equals 24, or more generally achieves the desired goal. When this occurs, a chain of thought prompt is created. In this final prompt the path that has been selected to arrive at a solution is injected and a final answer is given. An example of such a prompt could be structured as follows:</p><pre>cot_prompt = &#39;&#39;&#39;Use numbers and basic arithmetic operations (+ - * /) to obtain 24. Each step, you are only allowed to choose two of the remaining numbers to obtain a new number.<br>Input: 4 4 6 8<br>Steps:<br>4 + 8 = 12 (left: 4 6 12)<br>6 - 4 = 2 (left: 2 12)<br>2 * 12 = 24 (left: 24)<br>Answer: (6 - 4) * (4 + 8) = 24<br><br>Input: 2 9 10 12<br>Steps:<br>12 * 2 = 24 (left: 9 10 24)<br>10 - 9 = 1 (left: 1 24)<br>24 * 1 = 24 (left: 24)<br>Answer: (12 * 2) * (10 - 9) = 24<br><br>Input: 4 9 10 13<br>Steps:<br>13 - 10 = 3 (left: 3 4 9)<br>9 - 3 = 6 (left: 4 6)<br>4 * 6 = 24 (left: 24)<br>Answer: 4 * (9 - (13 - 10)) = 24<br><br>Input: 1 4 8 8<br>Steps:<br>8 / 4 = 2 (left: 1 2 8)<br>1 + 2 = 3 (left: 3 8)<br>3 * 8 = 24 (left: 24)<br>Answer: (1 + 8 / 4) * 8 = 24<br><br>Input: 5 5 5 9<br>Steps:<br>5 + 5 = 10 (left: 5 9 10)<br>10 + 5 = 15 (left: 9 15)<br>15 + 9 = 24 (left: 24)<br>Answer: ((5 + 5) + 5) + 9 = 24<br><br>Input: {input}<br>Steps:<br>{steps}<br>Answer: <br>&#39;&#39;&#39;</pre><p>Where {steps} are all the nodes that were voted/evaluated to be the most likely to achieve the end goal.</p><p>The ToT approach to problem-solving produced incredible results in the respective tasks compared to other techniques, as shown by the researchers in Figure 3.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/382/1*5SDVUBj365wO0bDpFvNoJQ.png" /><figcaption>Figure 3: Game of 24 success rates using different prompting techniques. (Yao et al, 2023)</figcaption></figure><h3>Benefits</h3><p>ToT offers several benefits for problem-solving with LMs:</p><ol><li><strong>Generality</strong>: Other prompting techniques like IO, CoT, CoT-SC, and self-refinement can be seen as special cases of ToT (i.e., trees of limited depth and breadth).</li><li><strong>Modularity</strong>: The base LM, thought decomposition, generation, evaluation, and search procedures can all be varied independently.</li><li><strong>Adaptability</strong>: ToT accommodates different problem properties, LM capabilities, and resource constraints.</li><li><strong>Convenience</strong>: No extra training is needed — a pre-trained LM is sufficient.</li></ol><h3>Considerations</h3><p>ToT requires more resources than conventional prompting methods to improve task performance; however, its modular flexibility allows users to customize performance-cost trade-offs. Increasingly performant open-source efforts, such as GPT4All or LLaMA, should help reduce these costs in the near future.</p><p>The researchers do note that deliberate search methods like ToT may not be necessary for many tasks that advanced LMs like GPT-4 already excel at. The tasks used in the paper, which challenge GPT-4, were simply used to demonstrate the higher requirement of better search and planning abilities.</p><h3>Conclusion</h3><p>As I am sure you can see the potential for this type of prompting technique is limitless. As LMs are applied to more real-world decision-making applications, more complex tasks could emerge, presenting new opportunities to apply prompting techniques such as ToT.</p><h3>Sources</h3><ul><li><a href="https://arxiv.org/pdf/2305.10601.pdf">Tree of Thoughts: Deliberate Problem Solving with Large Language Models</a></li><li><a href="https://github.com/ysymyth">ysymyth</a>/<a href="https://github.com/ysymyth/tree-of-thought-llm">tree-of-thought-llm</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dca7e719752" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>