If you have found this article insightful It is a proven fact that "Generosity makes you a happier person"; therefore, Give claps to the article if you liked it. If you found this article insightful, follow me on Linkedin and Medium. You can also subscribe to get notified when I publish articles. Let's create a community! Thanks for your support! You can click here to buy me coffee. Signing off, Chinmay


This AI newsletter is all you need #59

What happened this week in AI by Louie This week changes to Zoom's terms of service (from March) were brought into focus after fears over their use of customer video data went viral. Zoom's terms appeared to allow the company largely free reign to use customer's data to train their machine learning models, but after the controversy, late on Monday night, Zoom updated its terms to specify that "Zoom will not use audio, video or chat customer content to train our artificial intelligence models without your consent." Since the launch of ChatGPT and the increasing focus on commercializing AI, many companies' data ownership, copyright, and privacy policies have been in flux. Some companies, such as X/Twitter, have realized they have given away valuable data for free or too cheaply and have cut off access to their data, making it more difficult to scrape or launch lawsuits over its use. Other companies have realized they have not been collecting or making the most of the potentially valuable data they have access to. There is always going to be a fine balance between protecting customers' privacy and making the most of their data, and we expect these issues to remain high priorities for many CEOs and management teams in the coming months.- Louie Peters - Towards AI Co-founder and CEO


This AI newsletter is all you need #59

Hottest News AudioCraft: A Simple One-Stop Shop for Audio Modeling Meta has released the code and weights for their AudioCraft models, including MusicGen and AudioGen. These models generate music and audio, respectively, based on text-based user inputs. The release also includes the EnCodec decoder, which improves music quality. 2. NASA and IBM Openly Release Geospatial AI Foundation Model for NASA Earth Observation Data NASA and IBM Research have collaborated to release the HLS Geospatial FM, an open-source geospatial AI model for Earth observation data. This model has shown success in various applications, such as flood mapping, burn scar identification, and predicting crop yields. 3. Generative AI in Jupyter Jupyter AI integrates generative AI techniques and provides functionalities such as code generation, error fixing, content summarization, file questioning, and notebook creation from language prompts. 4. RT-2: New Model Translates Vision and Language Into Action Meta's Robotic Transformer 2 (RT-2) is a vision-language-action model that combines web-scale capabilities with robotic control. It effectively recognizes visual and language patterns, generalizes emergent skills, and successfully leverages web-based data to learn new skills. 5. OpenAI Launches GPTBot With Details on How To Restrict Access OpenAI has launched a web crawler, GPTBot, to improve its artificial intelligence models. GPTBot will scour the web for data while strictly filtering out any paywall-restricted sources, sources that violate OpenAI's policies, or sources that gather personally identifiable information.


This AI newsletter is all you need #59

Five 5-minute reads/videos to keep you learning The History of Open-Source LLMs: Better Base Models Open-source LLMs have evolved to become competitive with proprietary LLMs through advancements in pre-training and model development. Early challenges were overcome by focusing on the importance of pre-training and creating better base models. Recent trends include using larger pre-training datasets and optimizing models for fast inference. 2. Top 10 Open Source LLMs to USE in Your Next LLM Application This article highlights the top 10 open-source LLMs for the AI field. These LLMs offer customizable solutions, reasoning abilities, multilingual support, natural language understanding, text generation, question-answering, chatbot interfaces, versatility, and robustness. 3. Understanding LLaMA-2 Architecture and Its Ginormous Impact on GenAI Meta's 77-page paper on LLaMA-2 reveals impressive results, surpassing open-source benchmarks, and competing with GPT3.5. The article explains advancements like Grouper query attention, Ghost Attention, In-Context Temperature re-scaling, and Temporal Perception. 4. AI Researcher Geoffrey Hinton Thinks AI Has or Will Have Emotions AI researcher Geoffrey Hinton argues that human-like intelligence can only be achieved, and possibly surpassed, through deep learning because it enables machines to narrate hypothetical actions associated with emotions. The view has both supporters and critics in expert circles. 5. Fit Your LLM in a Single GPU With Gradient Checkpointing, LoRA, and Quantization This article presents three techniques - Gradient Checkpointing, LoRA, and Quantization - to help save GPU memory and avoid memory errors while fine-tuning language models. These techniques involve minimizing layers during training, embedding new trainable parameters, and reducing data precision.


This AI newsletter is all you need #59

Papers & Repositories microsoft/azurechatgpt: Azure ChatGPT, Private and Secure ChatGPT for Internal Enterprise Use Microsoft has introduced Azure ChatGPT, a private and secure solution for deploying ChatGPT instances on Azure. It offers built-in privacy guarantees, complete control over accessibility, and the ability to integrate internal data sources and plugins. To facilitate adoption, Microsoft has also developed a Solution Accelerator guide. 2. Tool Documentation Enables Zero-Shot Tool Usage With Large Language Models A recent study has found that, for LLMs, reading tool documentation is more effective than relying solely on demonstrations for learning to use new tools. Researchers demonstrated this through empirical findings on six vision and language tasks, showing that zero-shot prompts with tool documentation perform just as well as few-shot prompts on benchmarks. 3. PanGu-Coder2: Boosting Large Language Models for Code With Ranking Feedback This paper proposes a novel RRTF (Rank Responses to Align Test&Teacher Feedback) framework, which can effectively and efficiently boost pre-trained large language models for code generation. Under this framework, we present PanGu-Coder2, which achieves 62.20% pass@1 on the OpenAI HumanEval benchmark. 4. XSTest: A Test Suite for Identifying Exaggerated Safety Behaviours in Large Language Models This paper introduces a new test suite called XSTest to identify eXaggerated Safety behaviors in a structured and systematic way. The test results showed that the Llama2 model by Meta displayed excessive safety behavior, refusing prompts that were harmless but resembled unsafe ones or touching sensitive topics. 5. The Hydra Effect: Emergent Self-Repair in Language Model Computations A recent study in language models discovered the Hydra effect, where removing one attention layer triggers compensation in another. Additionally, researchers found that late MLP layers downregulate the maximum-likelihood token, even in models trained without dropout. Enjoy these papers and news summaries? Get a daily recap in your inbox!


This AI newsletter is all you need #59

Weekly AI Podcast In this week's episode of the "What's AI" podcast, Louis Bouchard shares his own journey of pursuing a Ph.D. in AI at Polytechnique Montreal and Mila. Throughout this episode, he provides insights into the admission process, the day-to-day life of a Ph.D. candidate, and the skills you develop along the way. He also delves into the concept of federated learning and how AI can revolutionize the diagnosis of multiple sclerosis. Whether you're considering a Ph.D. in AI or simply curious about the intersection of AI and medicine, this episode is for you. Tune in on Spotify, or Apple Podcasts.


This AI newsletter is all you need #59

Meme of the week! Meme shared by archiesnake


This AI newsletter is all you need #59

Featured Community post from the Discord Weaver159 has launched a new project called MetisFL, a federated learning framework that enables developers to federate their machine learning workflows and train their models across distributed datasets without having to collect the data in a centralized location. The core of the framework is written in C++ and prioritizes scalability, speed, and resiliency. Currently, the project actively encourages developers, researchers, and data scientists to experiment with the framework and contribute to the codebase. Check it out on GitHub and support a fellow community member. Share your thoughts or contributions in the thread here.


This AI newsletter is all you need #59

AI poll of the week! Join the discussion on Discord.


This AI newsletter is all you need #59

Article of the week Fit Your LLM in a single GPU with Gradient Checkpointing, LoRA, and Quantization by Jeremy Arancio Fine-tuning LLM can be long and tedious. Running out of memory during training can be both frustrating and costly. This article will go through three techniques that you may already use or need to know without understanding how they work: Gradient Checkpointing, Low-Rank Adapters, and Quantization. These techniques will help you avoid running out of memory during your training and save you a lot of time.


This AI newsletter is all you need #59

Our must-read articles Ensemble Learning: From Decision Tree to Random Forest by Sandeepkumar Racherla Modern NLP: A Detailed Overview. Part 4: The Latest Developments by Abhijit Roy Self-Supervised Learning and Transformers? - DINO Paper Explained by Boris Meinardus If you are interested in publishing with Towards AI, check our guidelines and sign up. We will publish your work to our network if it meets our editorial policies and standards.


This AI newsletter is all you need #59

Job offers Senior Software Engineer, Smart Contracts @Oasis Protocol Foundation (Remote) Senior Application Engineer @Mozilla (Remote) Senior/ Principal Support Engineer - Europe @ClickHouse (Remote) QA Engineer @ShyftLabs (Toronto, Canada) Senior Software Engineer - AI Search Personalization @Algolia (Remote) Senior Infrastructure Engineer @Angi (Remote) Python Data Engineer @Altoida (Boston, UK) Interested in sharing a job opportunity here? Contact sponsors@towardsai.net. If you are preparing your next machine learning interview, don't hesitate to check out our leading interview preparation website, confetti!


The Python Decorator That Supercharges Developer Experience

A Real-World Use-Case in Declarai  While developing Declarai - an open-source framework that translates Python code into LLM tasks - I came across the amazing advantages of using overloads. The Declarai package offers an interface to AI models from various providers. However, initializing these models is not straightforward. Each provider has its unique set of models, configurations, and associated API tokens. This is where overload comes in handy. Rather than depending on runtime errors to guide developers, we've employed overload to guide the developer about valid parameter combinations for each provider.


How we used @overload? In Declarai's primary interface, our objective is to guide developers in correctly initializing the Declarai class with the appropriate set of language model configurations. Therefore we can use the @overload decorator as follows to assist developers in initializing Declarai with models from - OpenAI, Huggingface, and AI21. In the example above, you can see different initializers are set for every provider. This ensures that developers receive guidance on the appropriate model names, configuration settings, and token parameters specific to the chosen provider. Disclaimer - Not all of the providers in the example above are implemented in Declarai. Those were just used as an example.


How Does This Impact the Developer Experience?  Consider the following PyCharm examples: You can observe how PyCharm IDE alerts about invalid model and parameter combinations, as well as unexpected arguments. Wow! Isn't this preferable to encountering runtime errors?


Conclusion The overload decorator in Python is more than merely a type-checking tool. In complex system interfaces, it acts as a guiding hand, ensuring developers select the right options and provide the appropriate parameters. This "small" things can create a developer experience that is both intuitive and error-resistant.


Follow Declarai  I hope you like the article, I would highly recommend you follow my Linkedin Page. Moreover I encourage you to explore Declarai in real-time and witness how great it is to work with a framework that harnesses overloads to make the developer experience much better. Check out the docs  Star us on github ⭐


Multimodal Language Models Explained: Visual Instruction Tuning

Multimodal Zero-shot learning using Instruction Tuning Fine-tuned LLMs showcase limited performance on unseen tasks, especially under distribution shifts. However, to generalize better on these downstream tasks, we can use instruction finetuning. Instruction finetuning is a technique to finetune a pre-trained LLM with an instruction dataset using reinforcement learning. In contrast, it was common to pre-trained LLMs with a masking task on a general-purpose dataset like C4 and then finetune it on a task-specific dataset such as translation (Bart) [5], code generation (CodeT5) [4] and parsing (ReportQL, HydraNet)[6, 7]. Instruction tuning learns a generalized understanding of how it should follow instructions to achieve a task rather than fitting it to a particular task. This gives the model higher generalization capabilities in a setting where enough instructions for every task have been provided. On the other hand, finetuning a language model is data-hungry which makes the approach less applicable when domain-specific data is limited. Although synthetic data for finetuning seems promising, much research has revealed the approach is prone to bias and lacks generalization to unseen samples [8]. Prompting improves performance on few-shot learning, especially in low-data regimes.


Multi-modal instruction dataset generation One of the major issues in extending instruction tuning to multi-modality is the lack of data. To provision a multi-modal instruction dataset researcher either adapts existing benchmarks or self-instruction. Zhu et al. [9] in their work "MiniGPT-4: Enhancing Vision-Language Understanding with Advanced Large Language Models," found that using publicly available image-text datasets results in suboptimal performance. They argue the lack of coherency, repetition, and fragmented sentences affects language models' dialog performance. Hence, MiniGPT-4 employs a two-step alignment process. In the first stage, they generate a verbose description of the image using prompting to the model derived from the first pretraining stage. They design a prompt specifically for conversational use cases to generate descriptions. Image features here incorporate features from a linear projection layer. When output length is below an 80 tokens threshold they precede the conversation with continue: Following this approach, they generated comprehensive descriptions for around 5,000 images from the Conceptual Caption dataset [10]. The generated dataset is still noisy and needs post-processing. The authors used ChatGPT to eliminate issues such as incoherent sentences and word repetition. To verify correctness, they manually assessed the image description and refined the generated captions. Finally, they sub-selected almost 3,500 from 5,000 generated pairs that satisfied their quality criteria. In contrast to MiniGPT-4, Liu et al. [11] only leveraged ChatGPT/GPT-4 to provision a multi-modal instruction dataset. The context of ChatGPT includes a symbolic representation consisting of captions and bounding boxes. Captions describe the scene from different perspective, while bounding boxes infers spatial information about objects. Using this context, they generate 3 types of instruction datasets. Firstly, conversation, which involves generating a set of a diverse set of questions asked about the content of images. The prompt also considers limiting questions to ones that can be confidently answered, given the context. The next type which is called "detailed description", aims to generate a comprehensive explanation for an image. Given an image, they randomly sample one question from a list of predefined questions to generate a detailed description. Finally, "complex reasoning" where here it refers to answering in-depth questions that require a step-by-step reasoning process that follows logic. To this end, they use a similar prompt to "conversation" but with more emphasis on reasoning. By using this approach, they generated a total of 158K language-image multi-modal datasets of which 58k samples of conversations, 23k samples of detailed description, and 77k samples of complex reasoning. Another line of work to provision a multi-modal instruction dataset is to apply instruction templates to already available language-image datasets. MultiInstruct by Xu et. al. [12] uses already available benchmarks for more than 47 tasks from 54 datasets to create a new multi-modal instruction dataset to allow LLMs to learn fundamental skills such as object recognition, visual relationship understanding, text-image grounding, and so on. As you might guess some of these benchmarks might overlap with each other, hence the authors considered the possibility of decomposing complex tasks into simpler tasks. Thereafter, 23 human annotators were assigned for each task to write 5 task-specific instructions for both training and evaluation. Instructions are formed in a unified format of <TEXT>, <REGION>, and <OPTION>. Here, <TEXT> is a placeholder for the instruction, <REGION> is the placeholder for region-specific information and <OPTION> is only used in classification tasks [12]. Otter [13], on the other hand, starts from MMC4 with the motivation to use context in the dataset. MMC4 consists of image-text pairs derived from webpages and "context" as the remaining text of the page. Similar examples are grouped to form a contextual example set. In short, common methods in the literature to provision multi-modal instruction datasets are self-instruct, which involves using a pre-trained network to generate instruction data. On the contrary, others have adapted already existing benchmarks in visual and multimodal learning. Moving forward, after dataset adaptation and generating visual instruction dataset for fine-tuning LLMs we need to create an interface to inject multi-modalities to LLMs.


Adapting LLMs for Multi-modal Prompts As it's challenging and costly to heavily change the architecture of LLMs and train them from scratch, we can see the dominance of methods similar to parameter-efficient fine-tuning [14] to inject visual embedding. Soft prompt along with a projection layer is one of the PEFT methods used in MiniGPT-4 [11] for embedding visual information. MiniGPT-4 leverages Vicuna as a language decoder and employs a ViT coupled with a pre-trained Q-Former. Soft prompting, in general, refers to prepending a trainable tensor to the model's input embedding to be optimized using backpropagation for a particular task. This tensor can have a length of roughly 1 to 150 tokens. Another variant of soft prompting is prefix-tuning. Unlike the previous approach, the trainable tensor will be prepended to hidden states of all layers. As we directly manipulate all layers, Li and Liang [15] found instability in optimizing the prepended tensor. As such, they use an intermediate FFN before directly prepending the tensor to the network. Switching back to MiniGPT-4, the authors inject the output of the pre-trained vision encoder as a soft prompt to the Vicuna through an FFN. During their first stage of training, both the vision encoder and language decoder networks are frozen while only one projection layer is trained. To align this projection layer, they use image-text pair datasets such as Conceptual Caption, SBU, and LAION for almost 20,000 training steps with a batch size of 256, covering approximately 5 million samples [9]. Similarly, X-LLM [16] aligns multiple frozen single-modal encoders for images, speech, and videos and a frozen LLM using dedicated interfaces for each modality. Moreover, instead of soft prompting, they adapt Q-Former to convert visual information into a sequence with quasi-linguistic embeddings as a part of the prompt. Q-Former from BLIP-2 is used as the interface for image and video modalities and needs to be adapted to convert the aforementioned modalities into languages. This is done in the first stage of the training where they used image-caption pairs and video-caption pairs to pre-train the module. As these two modalities are close to each other, they reused the parameter of the image interface but further fine-tuned it on video-text data [16]. For the speech interface, they used the CIF mechanism introduced in [17] to convert speech utterances into language. However, they found that although BLIP2 used English data for pre-training, it still performs well in the second stage. As a result, the authors choose to reuse the pre-trained parameters of the Q-Former and only train a CIF-based ASR model as their speech encoder. The Q-former module is accompanied by an adapter module to align the dimensions of the quasi-linguistic embeddings and the embedding dimension of the LLM [16]. In the second stage, each interface module is aligned further to the frozen LLM through 14 million Chinese image-text pairs and AISHELL-2 and the VSDial-CN dataset as the ASR training dataset. Conversely, Otter was trained with a few cross-gated attention layers to connect visual and language information and established attention between in-context examples, leaving the vision encoder and language decoder frozen [13]. In Flamingo, text generation by the LLM decoder is conditioned on the visual information embeddings produced by Perceiver Resampler. It takes an arbitrary number of image or video features encoded from a vision encoder model and produces a fixed-sized output to help reduce the complexity of the vision-text cross-attention module that interleaves the frozen LM blocks. The mentioned gated dense cross-attention module uses the tanh-gating mechanism used in LSTM [19]. It controls adding the result of attention to y from the residual connection through the learned alpha_xattn parameter. As of initialization, the output of attention and ffw are merely random and might cause training instability. Whereas with the gating mechanism alpha is initialized with 0 and has no effects at the beginning of the training. To recap, traces of PEFT are the major approach in the literature to adapt LLMs for multi-modality. In some cases, visual embeddings are directly represented in the prompt or the same as Flamingo, the architecture of LLM is more manipulated to trade-off for better accuracy. This field is relatively new and there are many lines of work that haven't been explored yet. In the next post from this series, I will be focusing on Multimodal few-shot learning using In-Context Learning.


The LLM Land Grab: How AWS, Azure, and GCP Are Sparring Over AI

Amazon Web Services: The Swiss Army Knife Approach With its vast array of cloud infrastructure offerings and unrivaled scale, Amazon Web Services (AWS) has firmly established itself as the dominant player in the space. However, the meteoric rise of large language models (LLMs) like GPT-3 poses a new challenge for the tech titan. Lacking an equally buzzworthy in-house LLM, AWS risks losing ground to rivals rushing their own models to market. So instead of trying to compete model-for-model, AWS has taken a different tack: enable access to as many models as possible via partnerships and collaborations. Enter Amazon Bedrock, launched in April 2023. Bedrock serves as a platform for developers to access and combine capabilities from a diverse roster of LLMs both old and new. This includes well-known names like Anthropic's conversational Claude 2, AI21 Labs' code-generating Jurassic-2, Cohere's multipurpose Command and Embed models, and Stability.ai's image synthesis tool Stable Diffusion. Rather than betting on any single model, AWS is positioning itself as the Swiss army knife of LLMs - granting developers the flexibility to mix and match the best features across a wide palette of models. And AWS isn't sitting idle on the LLM front, either. Though details remain sparse, it's developing its own homegrown LLM, Titan. But AWS' strength has always been its platform, not proprietary AI. By reducing friction to access and deploy LLMs, AWS is betting developers will stick with what they know.


Google Cloud: The Walled Garden Approach As a heavyweight in AI research, Google was perfectly positioned to capitalize on the explosion of large language models (LLMs). And in 2021, they unveiled LaMDA - an LLM rivaling the capabilities of GPT-3. Access to Google's AI models is provided through Model Garden, a managed service on the Google Cloud Platform (GCP). Model Garden provides enterprise-ready foundation models, task-specific models, and APIs to kickstart workflows. These include directly using models, tuning them in the Generative AI Studio, or deploying them to a notebook. As of August 2023, Model Garden includes homegrown models like the conversational LaMDA, text-to-image generator Imagen, and code autocompletion tool Codey. Google also has open-source models like BERT, T5, ViT, and EfficientNet for easy deployment on GCP. But Google isn't limiting Model Garden exclusively to its own AI. Third-party models are already being added, indicating Google wants to be the one-stop-shop for AI needs. However, competitors are unlikely to offer their most advanced models. The key question is which providers will license their models for availability on GCP. Subscribe now


Microsoft Azure: Betting on OpenAI Exclusivity Microsoft placed an early and sizeable bet on large language models (LLMs) that is paying off handsomely. Back in 2019, before most grasped the astounding potential of LLMs, Microsoft invested a cool $1 billion into OpenAI - the maker of GPT-3. This prescient investment secured Microsoft exclusive access to OpenAI's rapidly advancing LLMs, including enhanced versions of GPT-4 and image generator DALL-E. With OpenAI dominating AI headlines, Microsoft is now leveraging its exclusive access to lure customers to its Azure cloud platform. And it's working - by riding OpenAI's coattails, Azure is steadily chipping away at AWS's dominance in cloud market share. Yet Microsoft hasn't put all its eggs in the OpenAI basket. It recently partnered with Meta to launch LLaMA, an open-source LLM. This allows Microsoft to diversify its LLM portfolio beyond OpenAI, hedging its bets should a new model usurp GPT-3 as king of the hill.


The Rest: Diverse Approaches to Gain LLM Traction The major cloud platforms like AWS, Microsoft Azure, and Google Cloud boast eye-catching proprietary AI models to lure enterprise customers. Lacking standout in-house models, smaller cloud providers are taking a flexible "BYOM" (Bring Your Own Model) approach instead. Rather than scramble to develop unique "show pony" models, they enable customers to integrate third-party or custom models into workflows. IBM's watsonx service exemplifies this strategy. It offers an MLOps platform to build and train AI models tailored to specific needs. Watson X provides seamless integration with open-source repositories like Hugging Face for those wanting off-the-shelf models. This allows customers to tap into a vast range of pre-built models. Salesforce also combines internal R&D with external flexibility. Its capable AI Research team has steadily built up proprietary offerings like CodeGen, XGen and CodeT5+. But Salesforce cloud also natively supports partners' models from vendors like Anthropic and Cohere. This prevents customer lock-in while providing access to leading third-party AI. Oracle is betting on Cohere. It participated in Cohere's latest $270M round (along with Nvidia and Salesforce). Oracle's customers will have access to Cohere's LLM via Oracle Cloud Infrastructure. Cohere, for its part, is staying cloud agnostic by partnering with several cloud providers.


The AI Upstarts Beyond the major cloud infrastructure providers, companies specializing in data analytics and AI are also making plays. Instead of competing head-to-head with the large players, they aim to fill gaps and provide complementary capabilities. Snowflake allows customers to access a range of third-party LLMs from its Snowflake Marketplace. It's also developing its own model called DocumentAI for information extraction. Rather than be a one-stop model shop, Snowflake focuses on its strength - data integration - while partnering on AI. Databricks acquired MosaicML for its enterprise MLOps platform designed to build, deploy, and monitor machine learning models. MosaicML also produced the cutting-edge open-source LLM MPT-30B. With engineering and ML tooling, Databricks enables customers to create highly tailored AI solutions augmented by its partnerships. The battle for enterprise AI dominance is still in its early, unpredictable stages. While heavyweight cloud providers like AWS, Azure, and GCP today tout exclusive access to cutting-edge models like GPT-3 and Codex, smaller players are taking a different tack. By emphasizing flexibility, customization, and partnerships, they aim to enable customers to embrace AI's possibilities without vendor lock-in. It's easy to get absorbed by the strengths of players currently on the field. History shows us how a new entrant can scramble the board in unforeseen ways. Just as in 2007, when Steve Jobs unveiled the iPhone ending the Razr's reign virtually overnight. One thing is clear, the race is too early to call.


Enhancing E-commerce Product Search Using LLMs

Problem Statement Despite the pioneers like Amazon [2], many E-commerce platforms are still heavily relying on traditional retrieval techniques like TFIDF and BM25 for product search. Such sparse methods usually require customers to type explicit queries that match the product information and mostly struggle to achieve good relevance for queries that are colloquial and implicit. In consequence, the search engine either returns no result or results with low relevance ignoring the existence of the relevant ones, which harms the customer experience and business metrics. For instance, Ebay is returning "No exact matches found" for the query "What are the best gifts for boys under 5?". Although the "Results matching fewer words" solution avoids the "no result" situation, its search relevance has got the obvious potential to be improved. People might argue that it's rare for such queries to occur. However, it's not uncommon that many opportunities and advancements are actually driven by the use cases that are underestimated in the beginning.


LLM-based Solution Today, thanks to the fast development of LLMs, one can quickly build prototypes without worrying about the effort needed to build in-house solutions from scratch. This enables my quick discovery to tackle the problem. As depicted in the image below, the idea is pretty straightforward. The LLM is leveraged to translate the raw query to an enhanced query that aims to contain the explicit product information for search. Potentially, the product range covered in the enhanced query could be broad for the raw query that is implicit and fuzzy. In consequence, sending the enhanced query directly to the keyword-based search engine will likely lead to poor results due to its ambiguity and uncertainty. As a solution, LLM embedding is adopted to address the semantic complexity. Specifically, the enhanced query is projected into the embedding space that contains the preprocessed product embeddings. Next, the product retrieval is done by comparing the similarity between the query embedding and product embeddings, which then generates the top-k products as search results. There is a wide range of techniques to implement the idea as there exist many options for each step. Here, I provide one example implementation based on Hugging Face and LangChain. The actual code is hosted on the Github repo below, with the details explained as follows.


Generate the enhanced query First, the recently announced Llama 2 is adopted as the LLM to generate the enhanced query for a given raw query. As demonstrated below, the Hugging Face pipeline is used, considering its simplicity. It's worth noting that the pipeline itself is enough to accomplish the task so the use of LangChain is totally optional. The prompt template adopted here aims to generate relevant and diverse product names to address the fuzziness of the raw query.


Create product embeddings Next, the sentence transformer and FAISS in LangChain are used to create and store the product embeddings based on the product titles in the inventory. Here, due to the lack of access to actual search engines, the offline Ebay product dataset "products.csv" is adopted as the mockup of the E-commerce product inventory. This dataset contains approximately 3,000 products covering a wide range of categories.


Product retrieval When it comes to retrieval, the same sentence transformer model that encodes the products is used again to generate the query embedding for the enhanced query. Finally, the top-10 products are retrieved based on the similarity between the query embedding and product embeddings.


Showcase To demonstrate the effectiveness of this approach, let's look at the above-mentioned query "What are the best gifts for boys under 5?" and compare the LLM enhancement with the original Ebay search results presented in Figure 1. First, after receiving the raw query, Llama 2 generates 10 products as instructed by the prompt template. They look pretty impressive for boys' gift ideas although a better product-level granularity is expected. Next, let's have a look at the similarity match in the embedding space. What are retrieved from the product inventory mockup are not bad at all in comparison with the results of the real-world Ebay search engine in Figure 1. Due to the limited product range of the inventory mockup, the comparison is somewhat unfair but we are still able to observe the significant difference before and after applying LLM. Overall, the retrieval in embedding space achieves both relevance and diversity.


Final thoughts After conducting the initial discovery, it is obvious that LLMs are a powerful tool to enhance the product search of E-commerce platforms. For this task, there are many future explorations to conduct, including prompt engineering for generating queries, product embeddings with enriched attributes, online latency optimization for LLM query enhancement, etc. Hope this blog could inspire the E-commerce platforms that need solutions to improve product search.


References [1] Nayak, P. (2019) Understanding searches better than ever before, Google. Available at: https://blog.google/products/search/search-language-understanding-bert/ (Accessed: 09 August 2023).[2] Muhamed, A. et al. (no date) Web-scale semantic product search with large language models, Amazon Science. Available at: https://www.amazon.science/publications/web-scale-semantic-product-search-with-large-language-models (Accessed: 09 August 2023).


Fine-Tuning a Llama-2 7B Model for Python Code Generation

New Llama-2 model In mid-July, Meta released its new family of pre-trained and finetuned models called Llama-2, with an open source and commercial character to facilitate its use and expansion. The base model was released with a chat version and sizes 7B, 13B, and 70B. Together with the models, the corresponding papers were published describing their characteristics and relevant points of the learning process, which provide very interesting information on the subject. For pre-training, 40% more tokens were used, reaching 2T, the context length was doubled and the grouped-query attention (GQA) technique was applied to speed up inference on the heavier 70B model. On the standard transformer architecture, RMSNorm normalization, SwiGLU activation, and rotatory positional embedding are used, the context length reaches 4096 tokens, and an Adam optimizer is applied with a cosine learning rate schedule, a weight decay of 0.1 and gradient clipping.


The dataset for tuning For our tuning process, we will take a dataset containing about 18,000 examples where the model is asked to build a Python code that solves a given task. This is an extraction of the original dataset [2], where only the Python language examples are selected. Each row contains the description of the task to be solved, an example of data input to the task if applicable, and the generated code fragment that solves the task is provided [3].


Creating the prompt To carry out an instruction fine-tuning, we must transform each one of our data examples as if it were an instruction, outlining its main sections as follows: Output:


Fine-tuning the model To carry out this stage, we have used the Google Colab environment, where we have developed a notebook that allows us to run the training in an interactive way and also a Python script to run the training in unattended mode. For the first test runs, a T4 instance with a high RAM capacity is enough, but when it comes to running the whole dataset and epochs, we have opted to use an A100 instance in order to speed up the training and ensure that its execution time is reasonable. In order to be able to share the model, we will log in to the Huggingface hub using the appropriate token, so that at the end of the whole process, we will upload the model files so that they can be shared with the rest of the users.


Fine-tuning techniques: PEFT, Lora, and QLora In recent months, some papers have appeared showing how PEFT techniques can be used to train large language models with a drastic reduction of RAM requirements and consequently allowing fine-tuning of these models on a single GPU of reasonable size. The usual steps to train an LLM consist, first, an intensive pre-training on billions or trillions of tokens to obtain a foundation model, and then a fine-tuning is performed on this model to specialize it on a downstream task. In this fine-tuning phase is where the PEFT technique has its purpose. Parameter Efficient Fine-Tuning (PEFT) allows us to considerably reduce RAM and storage requirements by only fine-tuning a small number of additional parameters, with virtually all model parameters remaining frozen. PEFT has been found to produce good generalization with relatively low-volume datasets. Furthermore, it enhances the reusability and portability of the model, as the small checkpoints obtained can be easily added to the base model, and the base model can be easily fine-tuned and reused in multiple scenarios by adding the PEFT parameters. Finally, since the base model is not adjusted, all the knowledge acquired in the pre-training phase is preserved, thus avoiding catastrophic forgetting. Most widely used PEFT techniques aim to keep the pre-trained base model untouched and add new layers or parameters on top of it. These layers are called "Adapters" and the technique of their adjustment "adapter-tuning", we add these layers to the pre-trained base model and only train the parameters of these new layers. However, a serious problem with this approach is that these layers lead to increased latency in the inference phase, which makes the process inefficient in many scenarios.In the LoRa technique, a Low-Rank Adaptation of Large Language Models, the idea is not to include new layers but to add values to the parameters in a way that avoids this scary problem of latency in the inference phase. LoRa trains and stores the changes of the additional weights while freezing all the weights of the pre-trained model. Therefore, we train a new weights matrix with the changes in the pre-trained model matrix, and this new matrix is decomposed into 2 Low-rank matrices as explained here:


Merge the base model and the adapter weights As we mention, we have trained "modification weights" on the base model, our final model requires merging the pretrained model and the adapters in a single model. You can find and download the model in my Hugging Face account edumunozsala/llama-27b-int4-python-code-20k. Give it a try!


Inferencing or generating Python code And finally, we will show you how you can download the model from the Hugging Face Hub and call the model to generate an accurate result: Thanks to Maxime Labonne for an excellent article [9] and Philipp Schmid who provides an inspiring code [8]. Their articles are a must-read for everyone interested in Llama 2 and model fine-tuning. And it is all I have to mention, I hope you find useful this article and claps are welcome!! You can Follow me and Subscribe to my articles, or even connect to me via Linkedin. The code is available in my Github Repository.


References [1] Llama-2 paper [2] Link to the original dataset in the Huggingface hub [3] Link to the used dataset in the Huggingface hub [4] Fine-tuning a GPT - LoRA by Chris Kuo/Dr. Dataman [5] Edward J. Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yuanzhi Li, Shean Wang, Lu Wang, & Weizhu Chen. (2021). LoRA: Low-Rank Adaptation of Large Language Models. arXiv:2106.09685 [6]. QLoRa: Efficient Finetuning of QuantizedLLMs [7] Few-Shot Parameter-Efficient Fine-Tuning is Better and Cheaper than In-Context Learning [8] Extended Guide: Instruction-tune Llama 2 by Philipp Schmid. [9] Fine-Tune Your Own Llama 2 Model in a Colab Notebook by Maxime Labonne [10]. My Github Repository


GANs (Generative Adversarial Networks:)

INTRODUCTION: GANs, Generative Adversarial networks, let's first understand what GANs are. So I have already written a blog on Generative AI where we discuss many types of AI, the hype of AI, and why AI is tending nowadays in every sector like Healthcare, Finance, Trading, marketing, and many more. But exactly how this AI is able to generate all those look-alike images, fascinating views with intriguing colors and symphonies that are so sweet to hear, and so much more? GANs are a part of the deep-learning world and were very introduced by Ian Goodfellow and his collaborators in 2014, After that GANs have rapidly captivated many researchers' eyes which resulted in much research and also helped to redefine the boundaries of creativity and artificial intelligence in the world of AI


GANs (Generative Adversarial Networks:)

1.1 WHAT ARE GANs and HOW DO THEY WORK? So, have any of you heard of synthetic data? Yes, then fantastic. No concerns if the answer is no. Synthetic data is data that is not genuine but is manufactured by algorithms when actual data is unavailable. You can even think of synthetic data as a fake dataset. But, of course, how is it produced? what is the procedure? Did you say the algorithm? What exactly is the algorithm? The answer would be, GANs, Yes, a component of deep learning models used for generative tasks, create virtually anything phony, from deepfake films to look-alike photos to fake datasets of anything.


GANs (Generative Adversarial Networks:)

GANs are made up of two major neural networks: THE GENERATOR 2. THE DISCRIMINATOR:


GANs (Generative Adversarial Networks:)

GENERATOR: The Generator network takes random noise as input, considers random as completely random fake data, and then attempts to transform it into data that resembles the original data, or its target distribution. Consider the example of images. When dealing with images dataset, this network tries to produce images that appear precisely like the original dataset that we have given as input, but they are completely generated, i.e. false. So, in essence, this network learns to map noise vectors to data samples by modifying its parameters using backpropagation and gradient descent.


GANs (Generative Adversarial Networks:)

DISCRIMINATOR: The Discriminator network, on the other hand, functions as a classifier, attempting to differentiate between real data from the original dataset and bogus data generated by the Generator. It learns to give true data with high probability and false data with low probabilities. GAN training comprises a back-and-forth battle between these two networks. This is how it works:


GANs (Generative Adversarial Networks:)

TRAINING PHASE: The Generator generates fake data from random noise.The Discriminator assesses and assigns probability to both actual and bogus data.The Discriminator's purpose is to enhance its classification accuracy by learning to discriminate between true and bogus data.The Generator's purpose is to generate data that is compelling enough to "fool" the Discriminator. It modifies its settings to provide data that the Discriminator is more likely to recognize as real.


GANs (Generative Adversarial Networks:)

COMPETITION PHASE: The Generator produces fresh fictitious data.The Discriminator compares fresh phony data to actual data.The Discriminator's increased classification capacity may now allow it to better distinguish the new phony data.The Generator modifies its parameters in order to create more compelling results. This iterative procedure is repeated until the Generator generates data that is indistinguishable from actual data or a stopping requirement is satisfied. The success of GANs is dependent on striking a balance between the Generator and the Discriminator, where the Generator grows good at producing realistic data and the Discriminator becomes great at discriminating between genuine and false data. By capturing subtle patterns and distributions from training data, GANs have exhibited outstanding outcomes in a variety of disciplines such as picture production, style transfer, data augmentation, and more. Here's the coolest video about all the math behind the GAN architecture, explained so simply and efficiently do watch it if interested: https://youtu.be/Gib_kiXgnvA Step into the dynamic realm of Generative Adversarial Networks (GANs) and deep neural networks through PROJECT PRO Aside from theoretical explanations, this platform provides an immersive learning experience that includes both comprehension and actual application. You are not simply a passive student with PROJECT PRO; you become an active participant in the creation and fine-tuning of GANs and deep neural networks. You'll be led through every stage of development, from conceptualizing model architectures to coding and using actual datasets. Whether you're interested in picture creation, data augmentation, or other GAN applications, PROJECT PRO has the tools and resources to help you turn your ideas into real-world projects. With this interactive learning platform, you may improve your abilities, explore at your own speed, and bring your creative thoughts to reality. Visit them now: https://bit.ly/3OlIGoF


GANs (Generative Adversarial Networks:)

2. ADVANTAGES OF GANs: Now that we've learned about the inner workings of Generative Adversarial Networks (GANs), let's look at the particular benefits they have over other deep neural network approaches. These benefits extend beyond picture production, data augmentation, and image alteration, demonstrating GANs' unique ability to push the frontiers of artificial intelligence and creative applications.


GANs (Generative Adversarial Networks:)

2.1 HIGH-QUALITY IMAGE GENERATION: GANs' capacity to create high-quality pictures that closely resemble genuine photographs is one of its amazing capabilities. The Generator network creates visuals with amazing realism by learning the intricate patterns and structures of a dataset. This has enormous potential in disciplines like art, design, and entertainment, allowing for the production of lifelike pictures that push the limits of imagination.


GANs (Generative Adversarial Networks:)

2.2 DATA AUGMENTATION AND SYNTHESIS: By creating synthetic data, GANs serve a critical role in improving the efficiency of machine learning models. This method, known as data augmentation, entails the creation of additional instances that increase the variety of the training dataset. GANs thrive in this area by delivering data that accurately represents the original distribution. This is especially useful when data is scarce since it aids in model generalization and performance.


GANs (Generative Adversarial Networks:)

2.3 STYLE TRANSFER AND IMAGE-TO-IMAGE TRANSLATION GANs have the unique capacity to change the style or content of pictures, which leads to applications such as style transfer and image-to-image translation. GANs may transfer the creative style of one picture to another while keeping its content in style transfer. GANs help translate pictures from one domain to another in image-to-image translation, such as translating satellite images into maps or black-and-white photos into color images. This adaptability provides up opportunities for creative expression and practical solutions in a variety of sectors. GANs' strength rests in their capacity to address these difficulties with creativity and elegance, making them a driving force in creating the future of artificial intelligence and creative technologies.


GANs (Generative Adversarial Networks:)

REAL-WORLD USE CASES OF GANs: After we've mastered the fundamentals of GANs, let's look into the many real-world applications where their abilities shine. GANs have created intriguing pieces in art and design, such as "Portrait of Edmond de Belamy," which was auctioned off as AI-generated art. GANs are used by well-known fashion brands like Nike to create distinctive designs, while in healthcare, GANs generate synthetic medical pictures, enhancing diagnostic AI training in real time. NVIDIA replicates several driving scenarios in the field of autonomous vehicles, hastening self-driving car improvements. GANs are being used by architects to visualize interior designs, while GAN-generated immersive environments are being used to enhance video games. GAN-powered personalized fashion suggestions enhance the retail experience, while image restoration, medication discovery, and other sectors are being redefined. GANs are the catalysts that turn vision into reality in art, technology, and other fields.


GANs (Generative Adversarial Networks:)

LET'S PLAY WITH GAN A LITTLE: (CODE TO GENERATE IMAGES) This GAN model code demonstrates how to build, train, and visualize the results of a Generative Adversarial Network (GAN) using TensorFlow and Keras. Let's go through the key components of the code step by step:


GANs (Generative Adversarial Networks:)

Step1: Preparing and Downloading the Dataset: To begin, the code downloads and extracts the CelebA dataset. The collection is made up of celebrity face photos. The photos have been imported and are being preprocessed. They have been normalized to the range [-1, 1].


GANs (Generative Adversarial Networks:)

Step2: Discriminator Model Definition: A sequence of convolutional layers with LeakyReLU activations is used to create the discriminator model. The discriminator attempts to determine if an input picture is genuine or fabricated (manufactured).


GANs (Generative Adversarial Networks:)

Step3: Creating a Generator Model: To produce pictures, the generator model accepts random latent vectors as input and gradually upsamples them. It begins with a dense layer and then transforms the output to a 4D tensor. Convolutional transpose layers are used to upsample the data and produce a picture that mimics the dataset's genuine images. Step4: The GAN Model is defined as follows: The discriminator and generator are combined in the GAN class. It includes a train_step method for performing a single training step on both the discriminator and the generator. The discriminator is trained to tell the difference between actual and phony pictures, while the generator is trained to create images that deceive the discriminator. During training, random noise is injected into the labels to improve stability. Step5: Visualisation Custom Callback: At the conclusion of each epoch, the GANMonitor class creates and records a small number of created pictures. These graphics illustrate the generator's development throughout training.


GANs (Generative Adversarial Networks:)

Step6: Compilation and Training: The GAN model is compiled with binary cross-entropy loss and Adam optimizers for both the discriminator and generator. The gan.fit method is used to train the model. The dataset of celebrity face images is used for training. The GANMonitor callback is used to save generated images after each epoch.


GANs (Generative Adversarial Networks:)

Step7: Training Loop and Visualization: During training, the GAN alternates between updating the discriminator and generator. The discriminator aims to correctly classify real and generated images, while the generator aims to create images that can deceive the discriminator. Generated images are saved after each epoch using the GANMonitor callback. CODE REFERENCE: https://keras.io/examples/generative/dcgan_overriding_train_step/ Don't forget to follow us on social media platforms and share your views. Join our community of AI enthusiasts and let's continue pushing the boundaries of Generative AI together. Together, we can achieve great things! Join our LinkedIn group for data science and cyber security! You'll find the latest material blogs, exclusive content, and fellow enthusiasts. LINK FOR THE GROUP: https://www.linkedin.com/groups/9378874/ FOLLOW US FOR THE SAME FUN TO LEARN DATA SCIENCE BLOGS AND ARTICLES:  MAIL-ID: vidhiwaghela60@gmail.com LINKEDIN: https://www.linkedin.com/company/dsmcs/ INSTAGRAM: https://www.instagram.com/datasciencemeetscybersecurity/?hl=en GITHUB: https://github.com/Vidhi1290 TWITTER: https://twitter.com/VidhiWaghela MEDIUM: https://medium.com/@datasciencemeetscybersecurity- WEBSITE: https://www.datasciencemeetscybersecurity.com/ - TEAM DATA SCIENCE MEETS CYBER SECURITY


GPT-5 is now Trademarked by OpenAI: What Does That Say About the Future of ChatGPT?

I. The Trademark of GPT-5 In a 2014 BBC interview, Stephen Hawking said the following words - The state of AI in 2014 was different from today. AI was picking up interests in the corporate world. In that year, Google bought DeepMind - a machine learning startup - for over $600 Million. A year later, DeepMind created AlphaGo, which went on to beat Fan Hui, the European Go champion. Facebook then, on the other hand, was creating a system that could predict if two picture showed the same person. Development in Deep Learning was at its golden state. A small startup named OpenAI got formed then after a year, in Dec 2015. And now, 10 years later, after what now feels like a century of advancements in AI, OpenAI filed a trademark application for "GPT-5" on July 14 with the United States Patent and Trademark Office (USPTO). This move by OpenAI attracted many speculations. Many say it hints at the potential development of a new version of their language model after GPT4. This news popped up on Twitter/X post by a trademark attorney Josh Gerben on July 31st. The trademarking of GPT-5 came as a surprise for many of us. What is it hinting at?


II. OpenAI's Code Interpreter: A Stealthy Launch, bridging GPT-4.5 and GPT-5? Not too long ago, OpenAI released ChatGPT's newest feature: code interpreter. This was by far the most impressive feature addition to ChatGPT-4. Using the code interpreter, you could now run Python programs in ChatGPT, upload and even download files. Plus, it can even work with images to some extent. In a podcast on Latent Space (July 11), Simon Willison, Alex Volkov, Aravind Srinivas, and Alex Graveley argue that Code Interpreter is actually GPT-4.5. Of course, OpenAI hasn't announced whether this was indeed GPT 4.5 or not. However, this isn't something new. We had seen similar behavior before when OpenAI quietly released Gpt 3.5. This time, however, OpenAI might not have announced the Gpt 4.5 - keeping up with Sam Altman's (CEO of OpenAI) statement to adhere to the six pause letter. When talked about the viral open letter urging for a six-month pause in AI development, Sam said the following: In the same conversation, Sam's comment on GPT-5 development was that This talk was held at MIT in March of this year. You can watch the short clip here. Based on this, many of us became convinced that releasing GPT-5 anytime soon would be unlikely. This clear gap between finishing training and release for GPT-4 meant that the release of GPT - 5 hadn't started yet. At least, that was what was expected. However, OpenAI trademarking GPT-5 is something new. Could it be possible that OpenAI is already developing GPT-5? Is it a new marketing tactic to hype up AGI - a hypothetical AI that can do any task without any help? Squinting our eyes, we can find the clues in the trademark application itself.


III. Trademarking Tomorrow: GPT-5's Odyssey into the Multimodal Frontier Going into a bit more detail, the GPT-5 trademark application refers to 'downloadable computer programs and computer software related to language models.' This means that the trademark covers the 'program' and 'computer software' related to LLMs. GPT-5 could actually be an LLM that upcoming iterations of GPT-4 could utilize. Additionally, the main crux of the hint comes from the ones that I have highlighted above. The trademark application includes software for making speech and text, language processing, and machine learning. It also includes software for voice and speech recognition, converting audio files to text, and more. Does that give you some familiar scent? A chatbot that can - apart from generating responses - work with images, voices, speech, etc.? Ha! The multimodality of GPT. Multimodality refers to the ability to work with more than one type of input - like images, texts, audio and so on. People anticipated the release of GPT-4 with hoardings of 'the future is here' placards all over the internet. This anticipation was elevated when we got to know that GPT-4 could 'presumably' work with images in the near future. During the GPT-4 demo livestream 4 months ago we saw many impressive capabilities of the model. This included the ability to interpret memes and images, describe the various elements of the images, and so on. President and co-founder of OpenAI, Greg Brockman, demonstrated how he created a website using GPT-4. He did this by inputting a photo of an idea from his notebook, and GPT4 generated the code for the website. That was pretty impressive. We were convinced that the future was indeed near. But how near is it? As of now, the closest multimodal experience I ever had is with Bing Chat, which runs on GPT4. You could, in theory, make online searches using images and get results based on that. However, Bing still feels rusty and needs development. An experiment done by roboflow showed how good this multimodality feature of Bing is. Here are some noteworthy findings as covered in the report - Roboflow concluded the strengths and weaknesses - And Certainly, you cannot use it to make a website - as shown in the demo by Brockman - which makes Bing 'nearly multimodal' if not the least. I myself fed it some memes and it couldn't explain the humour in them - the same way it was shown in the live stream demo. This feature either needs some refinement, or my taste in memes are bad in itself. In my case, both are equally likely (I'm not a big fan of memes). Right now, only Bing Search - based on GPT-4 - lets you make searches using images. But the responses are not up to the mark, it seems. In the case of ChatGPT, especially GPT4, you can loosely associate multimodality with the Code Interpreter. It enables you to work with documents and images along with the power of ChatGPT. Feeding a document or image is indeed a 'new input' that differs from the text - making GPT-4 fall under multimodality. Thus it would be wrong to say that GPT-4 isn't multimodal yet. Code Interpreter gives some taste of multimodality. It sets the expectation of future capabilities on ChatGPT.


IV. Hype, Hope, and Dreams of AGI In a blog post, Sam declared that his company's Artificial General Intelligence (AGI) will benefit humanity and it "has the potential to give everyone incredible new capabilities." But we are nowhere near AGI. Is it even possible? We don't know. The 'experienced experts' believe we are far from AGI. Meanwhile, the 'AI doomers' believe we are close to AGI. And the 'AI influencers' don't care at all as long as there are apt contents out there. All these people have varied opinions on the future of AI, but one link ties them all: somewhere down below, they all are rowing in the stream of hype. Some oppose it, and some flow into it. And OpenAI seems to manifest the flow. Reporter Karen Hao - who wrote an extensive report on OpenAI's company culture in 2020 - suggests that OpenAI's internal culture has started to reflect less on safe and research-driven AI and more on getting ahead than everyone else. Thus, accusing the company of the "AI hype cycle." Here's an excerpt from the post. But let's assume the hype and rumors are true - OpenAI is building GPT-5 in their secret dungeon. They claim GPT-5 will be so impressive and will make humans question whether ChatGPT has reached AGI. The future is now here, once again. Going by the narratives and hype, GPT-5 or ChatGPT 5 would bring the following to the table: Multimodal capabilities: GPT-4 can already handle image and text inputs - and that's a good start. But there is still some scope for audio and video inputs. Companies like Google and Meta already demonstrated using various text-to-speech and text-to-music tools. Google also experimented with multimodal AI to develop the PaLM 2 language model. But these capabilities are still in fragments. If rumors are to be true, then the next ChatGPT would be a culmination of all these multimodal features. An all-in-one ChatGPT if possible. And of course, the competition in generative AI forces OpenAI and other AI companies to innovate something close to AGI. That's the expectation of this hype-driven AI race.Improved accuracy: While it is impossible to remove hallucination - aka the tendency of AI to make up facts - we have seen improvements in the newer GPT versions. According to OpenAI, GPT-4 is 60% less likely to make stuff up. Successive AI models try to be more accurate than their previous versions. We got to see this in GPT-3 and GPT-4, Llama and Llama2, and even in Claude and Claude 2 - where accuracy rate had noticeable improvement. The future version of GPT might expand its training dataset to fix inaccuracies. However, it would make it resource-heavy, as even the current ChatGPT takes $700,000 per day to run. If there isn't a better way to make it more accurate and less resource-demanding, GPT-5 would be far from the near future.Artificial general intelligence (AGI): This is the final destination that every AI research company is heading to. Whether it is achievable or not is still under debate - but it is reasonable to say that AGI is unattainable any time soon. AGI, in theory, is do-anything-on-its-own AI, but how to approach it practically is where the roadblock comes in. Computers are not out there in the world, and in order to do tasks for humans, they need to interact with the environment. How to go about it? Nobody quite knows, but the answers seem to lie in the conjugation of Neuroscience and deep learning. If GPT-5 comes up with AGI - which is highly speculative - it would be yet another milestone; not just for AI but for the whole field of technology. Resurrecting a living and thinking mind from algorithms would undoubtedly be marvelous.


V. Forging the AGI dream As I am writing this, the GPT-5 trademark application is currently awaiting examination. But whenever things like this grab the headline it sparks a lot of curiosity, as well as speculation in the AI community. There are always two divisions of the crowd - one, those who view it in a skeptical way, and the other who view it in an optimistic way. One class believes in the facts of yesterday, and the other class believes in the hopes of tomorrow. Nonetheless, both classes are equally important - especially when it comes to governing AI. With tighter regulations and laws - the likes of the EU AI Act and the US AI Bill - it is getting restrictive for AI companies to vouch for breakthroughs. But are such strict measures justified, though? I believe it is. If you observe the amount of developments in the past few years in the realm of AI, the growth has been exponential. But the safety aspects, arising from the growing competition in the corporate world, is a matter of concern. OpenAI became a for-profit company. Investors started to burn money behind any company that is turning 'AI Powered', making competition intense in the AI race. Just progress isn't enough. We need safe progress - safe progress in the development of NLP, multimodality, and artificial general intelligence. But pushing for trademarks - as a way to protect intellectual property, or for a marketing strategy to create hype and anticipation - doesn't lower competition. It just increases it. With that said, if GPT-5 is going to be at par with our expectations, then it would undoubtedly be a game-changer yet again in the field of AI. But that is if it ever becomes something close to AGI, if not complete AGI. Yet, even in our craziest dream, if we DO get to AGI, then safety and regulation have to be the priority. Otherwise, our pursuit of AGI in the AI race, from the words of Hawking, could spell the end of the human race. AGI in the wild can-do wonders - even from the perspective of destruction.


Inside XGen-Image-1: How Salesforce Research Built, Trained, and Evaluated a Massive Text-to-Image Model

Training Most text-to-image models have pioneered their own training methodology. XGen-Image-1, charted a different course, focusing not on the straightforward challenges of conditioning, encoding, and upsampling but rather on the extent of their reusability. This distinctive perspective led them to experiment with the thresholds of efficient training, probing the boundaries of low-resolution training via the amalgamation of pretrained autoencoding and pixel-based upsampling models. As the pipeline illustratively depicts, a pretrained autoencoder combined with optional pixel-based upsamplers empowers low-resolution generation while producing images of grandeur (1024x1024). Their outlook extends to further exploration of the practical lower bounds of resolution. Quantitative evaluation occurs at the 256x256 juncture, directly following the VAE phase devoid of upsampling. Qualitative evaluation leverages a "re-upsampler" journeying from 256 to 64 to 256, mirroring SDXL's "Refiner," along with a 256 to 1024 upsampler.


Training Infrastructure Salesforce Research undertook model training on TPU v4s. Throughout the training process, the team harnessed Google Cloud Storage (GCS) for preserving model checkpoints. Additionally, Gloud-mounted drives were harnessed for storing expansive datasets. A robust training regimen unfolded on a v4512 TPU machine, spanning 1.1 million steps over the course of approximately 9 days, encompassing hardware costs approximating $73k, which is super cheap compared to alternatives! The process was not without challenges. The model's loss exhibited erratic fluctuations from step to step, despite generous batch sizes. The root cause was related to the uniform seeding across all workers, which resulted in this volatility. The resolution materialized through random seeding, aligned with each worker's rank, fostering a balanced dispersion of noise steps and ushering in smoother loss curves.


Evaluation To evaluate XGen-Image-1, Salesforce Research used a methodology that encompasses a dual-axis representation, with the x-axis portraying CLIP Score - an embodiment of alignment to prompts - while the y-axis encapsulates FID (Frechet Inception Distance), an indicator of appearance similarity across the dataset. This evaluation transpires across 15 guidance scales, involving 30,000 image-prompt pairs in the initial figure. For inter-checkpoint comparison, this scope narrows to 1,000 pairs. Data pairs are meticulously sampled from the COCO Captions dataset, wherein captions are enriched with "A photograph of" to mitigate FID penalties linked to disparate graphic styles. Salesforce Research also used human evaluation to benchmark XGen-Image-1. This evaluation, conducted through Amazon Mechanical Turk, involves participants discerning image-prompt alignment. With a resolute dedication to precision, respondents engage with all 1,632 prompts across six distinct trials, culminating in a substantial repository of ~10k responses per comparison.


Generating High-Quality Images An important part of the XGen-Image-1 building was to ensure that it generates high-quality images. This process was based on two well-known tricks. The initial strategy revolved around generating a substantial array of images and subsequently cherry-picking the most optimal. Upholding the steadfast principle of maintaining a one-prompt to one-output structure, Salesforce Research delved into automating this methodology. Exploration of this approach led them to delve into rejection sampling - a technique encompassing the generation of multiple images, followed by an automated selection of the most fitting candidate. An array of metrics were initially considered, encompassing aesthetic score and CLIP score. Ultimately, the team found PickScore to be a robust overarching metric. This metric, as substantiated within the literature, showcased a remarkable alignment with human preference - a pivotal trait. Following this methodology, XGen-Image-1 generates 32 images (in a 4x8 grid) within approximately 5 seconds on an A100 GPU and selects the one that scores the highest. The second technique, manifesting as an exemplar of image improvement, materialized through inpainting regions that presented suboptimal aesthetics. Segmentation masks, extrapolated from prompts, encapsulated the target object.2. Objects were duly cropped based on these segmentation masks.3. The crop underwent expansion.4. Employing img2img operations on the crop, paralleling the segmentation prompt with matching captions (e.g., "a photograph of a face"), facilitated regional refinement.5. The segmentation mask played a pivotal role in seamlessly blending the augmented crop back into the original image.The combination of both methods led to high-quality image creation in XGen-Image-1. XGen-Image-1 is not a breakthrough in the text-to-image model, but it still provides some very useful contributions. The biggest one is to showcase that it is possible to reuse many pretrained components to achieve state-of-the-art performance in this type of model. X-Gen-Image-1 achieved performance similar to StableDiffusion while using a fraction of the training computation resources. Very impressive indeed.


The Evolution of Tabular Data: From Analysis to AI

Introduction Tabular data refers to data organized into rows and columns. It encompasses everything from CSV files and spreadsheets to relational databases. Tabular data has been around for decades and is one of the most common data types used in data analysis and machine learning. Traditionally, tabular data has been used for simply organizing and reporting information. However, over the past decade, its usage has evolved significantly due to several key factors: Kaggle Competitions: Kaggle emerged in 2010 [1] and popularized data science and machine learning competitions using real-world tabular datasets. This exposed many data scientists and machine learning engineers to the power of analyzing and building models on tabular data.Open-source Contributions: Thanks to major open-source libraries like Pandas, DuckDB, SDV, and Scikit-learn, manipulating, preprocessing, and building predictive models on tabular data is now incredibly easy. Additionally, open-source datasets provide beginners with easy access to practice on real-world datasets.Generative AI: Recent advances in generative AI, especially large language models, now enable the generation of realistic tabular data and make it easy for basically anyone to conduct Data analysis and build machine learning applications. In the essay, we will discuss each of these factors in more detail and look at examples of how companies and researchers are using tabular data in innovative ways today. The main takeaway will be the importance of analyzing and preparing tabular data in the right way to reap the benefits of machine learning and AI.


Tabular Data Kaggle Competitions The Kaggle Competition has profoundly impacted the field of data science and machine learning engineering. Additionally, Tabular competitions have introduced new techniques, tools, and various tabular tasks. In addition to learning and knowledge development, winning competitions often come with cash prizes, providing further motivation for participation. For example: On average, Kaggle competitions offer prize money of around $21,246 and have approximately 1,498 participating teams.The largest cash prizes have been as high as $125,000, giving the winners a significant incentive to go the extra mile and push the boundaries of what's possible with tabular data. Over the last decade, Kaggle has hosted numerous competitions centered around tabular data, with several since 2015 offering cash prizes of up to $100,000 for the winning team. The number of tabular data competitions has grown significantly over this period, with particularly high activity in 2015 and 2022.


Tabular Playground Series Due to the large demand for tabular data problems, the Kaggle staff started an experiment in 2021 [2] by launching a monthly contest called the Tabular Playground Series. These competitions aimed to provide a consistent platform for competitors to hone their skills on tabular data. The Tabular Playground Series contests were based on synthetic datasets that replicated the structure of public data or data from previous Kaggle competitions. The synthetic datasets were created using a deep-learning generative network called CTGAN.[3] Exposure: Many machine learning practitioners got their first exposure to working with tabular data through Tabular Playground Series. This helped familiarize them with concepts like data loading, feature engineering, and model tuning.Techniques: Kaggle competitions showcased techniques like feature engineering, data augmentation, and ensemble modeling that are particularly useful for tabular data. Competitors used these techniques to achieve higher scores, setting examples for others.Community: The discussions within Kaggle competitions provided a fertile ground for sharing techniques and ideas on how to best handle tabular data. This helped form a community of practice around tabular data.Democratization: Kaggle competitions have made machine learning on tabular data more accessible to a wider audience, not just data experts. Participants get free access to both CPU and GPU, as well as to large datasets, and anyone is welcome to participate in the competition. The Tabular Playground Series is still ongoing, currently in Season 3 with Episode 18. This demonstrates that cash prizes are not the only motivation for participants, as these competitions do not offer any monetary prizes or points systems. Rather, the series caters to data enthusiasts who want to hone their skills by practicing various types of tabular data.


Competition Solutions Examination of winning solutions has revealed that fancy tools or deep learning models are not necessary to place highly. Even simpler models like linear regression, with careful feature engineering, can win prizes. The key is finding simple yet effective techniques for solving the given problem. For example, the winner [4] of the GoDaddy - Microbusiness Density Forecasting competition [5] used Linear Regression. This is unsurprising as winning solutions are often based on simple models but involve extensive feature selection, cross-validation, data augmentation, and ensemble techniques.


Tabular Data Open-source Contributions Open-source contributions related to tabular data have been invaluable for advancing the field and enabling real-world applications. Contributions fall into two main categories: Open-source DatasetsOpen-source Tools


Open-source Datasets Kaggle owes its success to the generous contributions of open-source contributors who share real-world tabular datasets for machine learning problems. These datasets, covering various domains and use cases, provide valuable training and benchmarking data for the machine learning community. Numerous companies and organizations have openly contributed their proprietary tabular data to advance the field. The remarkable number and diversity of datasets available on Kaggle have been an essential driver for innovation in working with tabular data. Kaggle dataset [6] is the go-to place for beginners and experts alike who are looking for specific datasets. Its vast collection of tabular datasets is helping hundreds of community members daily to practice new techniques and handle new types of data.


Open-Source Tools Several major open-source tools for analyzing, manipulating and modeling tabular data have been made possible by the contributions of developer communities. Tools like Pandas, Numpy, scikit-learn, TensorFlow, XGBoost, and many others have been crucial enablers for working with tabular data at scale. These libraries provide a comprehensive set of functionalities that have made tabular data machine learning accessible to a wide audience. Ongoing community contributions ensure the tools continue to improve and keep pace with new requirements. Additionally, there are now efficient tools available such as DuckDB and PySpark, that offer a user-friendly yet powerful way to analyze and process large tabular datasets. With DuckDB, you can easily import a CSV file and run SQL queries in just seconds. Perform quick and multiple actions on tabular data using Python Relational API. Its syntax is similar to pandas, making it easy to use.


Generative AI for Tabular Data Generative AI is a subfield of artificial intelligence powered by neural networks like Variational Autoencoders and Generative Adversarial Networks (GANs) that can generate photorealistic images, compose original pieces of music, write news articles and stories, and even design objects. It is trained on large datasets, allowing Generative AI models to discover the underlying patterns, structures, and statistical distributions present in the data. Generative AI models have significantly progressed the field of working with tabular data. Capabilities like data augmentation, anomaly detection and synthetic data generation have helped tackle issues like data scarcity, privacy and bias. However, recent advances like ChatGPT and other large language models (LLMs) are now also being used as assistants for tabular data tasks. Some of the ways generative AI is transforming our workflows include: Code assistance: LLMs like ChatGPT can help with coding tasks like feature engineering, preprocessing, modeling and evaluating machine learning pipelines for tabular data. They can suggest code snippets, functions and entire scripts.Data understanding: Generative AI can provide insights into the data distributions, correlations, missing values, outliers, target variables and more.Deep analysis: It performs statistical tests, creates visualizations and derives other summary metrics that give practitioners a thorough analysis of tabular datasets to inform modeling decisions.Web scraping: Generative AI tools can help you scrape new tabular data from websites/application, assisting with data acquisition tasks. While issues like safety, bias, and narrow capability remain, large language models are beginning to transform how data scientists and machine learning engineers work with tabular data on a day-to-day basis. They are increasingly becoming assistants that handle various analytical and coding tasks, freeing up practitioners to focus on higher-level work.


ChatGPT for Tabular Data ChatGPT [7] has rapidly become an invaluable assistant for nearly every stage of working with tabular data, from helping with data cleaning and feature engineering to generating complex model code, interpreting metrics, producing data analysis reports, and even aiding in synthetic data generation for tasks like data augmentation and anomaly detection. With ChatGPT, you can easily build and train a machine-learning model by simply typing a detailed prompt. Additionally, you can utilize multiple plugins to automate complex tasks such as running the code and getting internet access. Check out "A Guide to Using ChatGPT For Data Science Projects"[8] to learn how to use ChatGPT in a real-life end-to-end data science project.


Generative AI Tools for Tabular Data Generative AI tools, such as PandasAI [9], have made data analysis, dataset cleaning, and data visualization extremely easy for anyone. These tools use large language models like gpt-3.5-turbo [10] to generate insightful results. Additionally, you can also connect with open-source models hosted on Hugging Face to perform AI analysis. To see the top five competitions with the highest RewardQuantity, we asked ChatGPT to display them by typing a prompt. You can even ask it to perform complex tasks or generate visualizations. This is just the beginning, as we will see many new AI tools that make data scientists' and developers lives easier by automating tasks and providing assistance.


Conclusion While significant progress has been made in leveraging tabular data for machine learning and AI applications, we have likely only seen the beginning. In the future, we can expect new powerful tools driven by advanced AI agents [11] that will automate the entire workflow for tabular machine learning tasks - from data ingestion and cleaning to feature engineering, model training, evaluation, and deployment in web applications. With continued advances in generative AI and natural language processing, these agents will be able to take high-level prompts to complete entire tabular data science projects, from data to insights. This essay highlights the significant impact of Kaggle competitions, open-source communities, and generative AI on our approach to working with tabular data for tasks such as data analysis and machine learning. To delve deeper into the topic, you can read the winning essays from the 2023 Kaggle AI Report competition.[12]


Reference [1] Wikipedia contributors, "Kaggle," Wikipedia, Jun. 2023, [Online]. Available: https://en.wikipedia.org/wiki/Kaggle [2] "Tabular Playground Series - Jan 2021  Kaggle." https://www.kaggle.com/competitions/tabular-playground-series-jan-2021 [3] Sdv-Dev, "GitHub - sdv-dev/CTGAN: Conditional GAN for generating synthetic tabular data.," GitHub. https://github.com/sdv-dev/CTGAN [4] KAGGLEQRDL, "#1 solution - generalization with linear regression," Mar. 16, 2023. https://www.kaggle.com/competitions/godaddy-microbusiness-density-forecasting/discussion/395131 [5] "GoDaddy - Microbusiness Density Forecasting  Kaggle," Dec. 15, 2022. https://www.kaggle.com/competitions/godaddy-microbusiness-density-forecasting/overview [6] "Find Open Datasets and Machine Learning Projects  Kaggle." https://www.kaggle.com/datasets [7] "Introducing ChatGPT," OpenAI, Nov. 30, 2022. https://openai.com/blog/chatgpt [8] A. A. Awan, "A Guide to Using ChatGPT For Data Science Projects," Mar. 2023, [Online]. Available: https://www.datacamp.com/tutorial/chatgpt-data-science-projects [9] Gventuri, "GitHub - gventuri/pandas-ai: Pandas AI is a Python library that integrates generative artificial intelligence capabilities into Pandas, making dataframes conversational," GitHub. https://github.com/gventuri/pandas-ai [10] "GPT-3.5," OpenAI. https://platform.openai.com/docs/models/gpt-3-5 [11] R. Cotton, "Introduction to AI Agents: Getting Started With Auto-GPT, AgentGPT, and BabyAGI," May 2023, [Online]. Available: https://www.datacamp.com/tutorial/introduction-to-ai-agents-autogpt-agentgpt-babyagi [12] "2023 Kaggle AI Report." May 2023, [Online]. Available: https://www.kaggle.com/competitions/2023-kaggle-ai-report/leaderboard


What is MLOps

Background Saying that MLOps is in a state of flux would be an understatement [7]. The best advice that I could give on MLOps would be to try to hire someone who is able to see the "big picture". Any competent software engineer can learn how to use a particular MLOps platform since it does not require an advanced degree. Therefore, a common mistake when interviewing applicants is to focus on the minutia of a particular platform (AWS, GCP, Databricks, MLflow, etc.). The ideal MLOps engineer would have some experience with several MLOps and/or DevOps platforms. In fact, too much experience with a single platform will most likely be problematic in the future since most companies seldom stay with one cloud platform over time, and there are not currently any standards for MLOps. A major problem with MLOps is the lack of standards which means that each platform tends to use different terminology. Hopefully, SEI or IEEE will soon publish an AI Engineering guide to standardize the terminology similar to SWEBOK. For now, I would recommend learning MLflow since it is open-source and seems to be very popular.


What is MLOps

The Machine Learning Model Process In general, the ML model process involves eight stages (Figures 2 and 3) which may include data collection and/or data labeling [1]: Data preparationFeature engineeringModel designModel training and optimizationModel evaluationModel deploymentModel servingModel monitoring In contrast, ModelOps is focused on managing the full software development life cycle (SDLC) of a variety of AI models, including machine learning, knowledge graphs, rules, optimization, natural language, and agent-based models (Figure 4).


What is MLOps

The Machine Learning Workflow Machine learning requires experimenting with a wide range of datasets, data preparation, and algorithms to build a model that maximizes some target metric(s). Once a model has been built, the next step would be to deploy the final model to a production system, monitor model performance, and continuously retrain the model on new data and compare it with alternative models. Therefore, being productive with machine learning for real-world applications can be challenging for several reasons [3]: It is difficult to keep track of experiments. When working with files on your laptop or with a notebook, how can we tell which data, code, and parameters were used to obtain a particular result?It is difficult to reproduce code. Even if we carefully track the code versions and parameters, we still need to capture the entire environment (such as library dependencies) to reproduce the same results. This is even more challenging when working in a team or if we want to run the same code at scale on another platform (such as the cloud).There is no standard way to package and deploy models. Every data science team develops its own approach for each ML library that is used, so the link between the model and the code and parameters is often lost.There is no central store to manage models (versions and stage transitions). Without a central place to collaborate and manage the model lifecycle, data science teams will encounter challenges managing model stages. Although individual ML libraries provide solutions to some of these problems (such as model serving), you usually want to try multiple ML libraries to get the best results. An MLOps tool allows you to train, reuse, and deploy models with any library and package them into reproducible steps that other data scientists can use as a "black box" without needing to know which libraries you are using. Thus, an MLOps platform must provide at least five features to help manage the ML workflow [3]: Tracking: an API for logging parameters, code versions, metrics, and artifacts when running machine learning code and later visualizing the results.Projects: a standard format for packaging reusable ML code.Models: a convention for packaging ML models in multiple flavors and a variety of tools to help in deploying them.Registry: a centralized model store, set of APIs, and UI, to collaboratively manage the full lifecycle of an ML model(s).Scalability: designed to scale to large data sets, large output files, and a large number of experiments.


What is MLOps

Conclusion MLOps is a set of methods and techniques to deploy and maintain machine learning (ML) models. However, MLOps does not currently have any standards defined, so it is important to keep this in mind. Therefore, it is important to see the "big picture" which involves understanding the key concepts, stages, features, and challenges with MLOps.


What is MLOps

References [1] J. S. Damji and M. Galarnyk, " Considerations for Deploying Machine Learning Models in Production," Towards Data Science, Nov. 19, 2021. [2] B. Rogojan, " What Is MLOps And Why Your Team Should Implement It," SMB Lite, Nov. 25, 2020. [3] " MLflow Concepts," MLflow Documentation, Last accessed: Aug. 19, 2022*.* [4] L. Visengeriyeva, A. Kammer, I. Bär, A. Kniesz, and M. Plöd, " MLOps Principles," , Last accessed: Aug. 19, 2022. [5] P. P. Ippolito, " Design Patterns in Machine Learning for MLOps," Towards Data Science, Jan. 12, 2022. [6] Abhijith C, " How (not) to do MLOps," Towards Data Science, Jan. 10, 2022. [7] M. Eric, " MLOps Is a Mess But That's to be Expected," KDnuggets, Mar. 25, 2022. [8] " MLflow Quickstart", MLflow Documentation, Last accessed: Aug. 19, 2022. [9] Kedion, " Managing Machine Learning Lifecycles with MLflow," Medium, Jan. 25, 2022. J. Demsar, T. Curk, A. Erjavec, C. Gorup, T. Hocevar, M. Milutinovic, M. Mozina, M. Polajnar, M. Toplak, A. Staric, M. Stajdohar, L. Umek, L. Zagar, J. Zbontar, M. Zitnik, and B. Zupan, " Orange QuickStart," Orange Documentation, Last accessed: Aug. 19, 2022. Y. Prakash, " A Quick Guide To ML Experiment Tracking - With Weights & Biases," Towards Data Science, Mar. 7, 2022. wallaroo.ai, " How to Evaluate Different Machine Learning Deployment Solutions," Medium, Mar. 3, 2022. A. Lamberti, " 4 MLOps Tools To Deploy Your Machine Learning Model," Artificialis, Jan. 5, 2022.


The Cantilever v/s ChatGPT

Prompt 1: Write a Python code for constructing a cantilever bar with weight at the end. On the first try, the bot confidently gave the code and said (paraphrasing), "Yes, I'm certain I've got exactly what you need. Here's the code." And as oblivious as the human race is to details, it is more so with a false sense of assurance by a bot. Let's be fair, why would someone expect a bot to lie? Unless, The bot believes in itself a bit too much. The bot has no humility. "Everyone believes me, ergo I must be the epitome of truth". But we digress. Getting back to the cantilever - The code written for this assumed the load was along the length of the cantilever; hence the plot of deflection v/s length is uniform. Maybe ChatGPT needed more context, I assumed. Maybe it's focussing more on the other words rather than 'cantilever'. With this in mind, I decided to first clear out what a cantilever is with the bot. Gave it a task so it would learn it. The second time around, I tried getting ChatGPT to define Cantilever as a Python Class (a hopeful attempt #2), and then work on the problem, with the hope that it would have more insight (given that it's a learning model).


The Cantilever v/s ChatGPT

Attempt 2: Define a cantilever in Python This seemed to go pretty well. The class definition was neat, with a self-function for deflection calculation. One would feel proud. It was too good: the tip-deflection had no significant error with respect to the analytical solution. I ignored it too at first;"Why doubt a good thing?" The complete deflection map was linear, though. Deflection isn't supposed to be linear, is it? ChatGPT understood what I needed in the deflections attribute but wrote the code incorrectly. I wanted a deflection array of different points along the cantilever. Instead, it plotted for different load strengths at the end. This will obviously be a linear curve (rather than the expected cubic) because it is being drawn against Load (P) and not distance (x). Analytically, the solution looks like: Where,P = Tip loadx = distance from the jointE = Young's ModulusIᵧ = Moment of Inertia about y-axisL = Length of rod Stressed and worried about the code (cue, a number of undocumented attempts), I re-read the previously generated codes, looking for a mistake, looking for a line I might have missed, only to find what was staring at my face: ChatGPT used the analytical function of deflection for itself.


The Cantilever v/s ChatGPT

Blasphemy One would find it in the class definition itself and say, "Oh, that wasn't really hard to find." What you need to understand is that this was neither my only try nor was this a one-day endeavor. Time to restart. Redo. Renew. A new chat. With a fresh mind and a different approach planned, I logged into Open AI. Before doing anything related to the task at hand, I first needed to check one thing; for my sanity: That's comforting, isn't it? As experience has taught us, don't trust the bot. But we can give it the benefit of the doubt. We needed the bot to understand two things: one, what a cantilever is, and two, how to perform a finite difference analysis on it. This is a lovely point to stop and analyze a learning model. We asked it to learn what a cantilever is first and then perform a finite difference analysis (FDM) on it. This failed because the quantity we wished to analyze using finite difference was already defined analytically by the bot in its definition of the cantilever. This is why we go for this the other way (fingers crossed, the third time's the charm, attempt #3): Ask it to perform some basic finite difference exemplars and then move on to a cantilever.


The Cantilever v/s ChatGPT

Attempt 3: Apply finite difference analysis to solve for a cantilever with a tip load This was a fair success. Although, as is evident, this isn't close to the exact solution of the cantilever (arrived at analytically) since it seems to have been solved using first-order approximations. In the above execution of the method, ChatGPT was great at recognising the correct algorithm and implementing it. The more nuanced issues, like knowing that the limit for a matrix can't go beyond n when creating a tri-diagonal matrix, are something the bot misses out on. These are things that we, as human coders, recognize and know to work around. To conclude, ChatGPT is a pretty good large language model. But it does well in the languages, is all. Mastering code is something it hasn't or (from our experience), won't be able to master. It brings about a contradiction in the way of the world. We can write code. Code can't write code about or greater than itself.


The Cantilever v/s ChatGPT

The Poet Final prompt to the poet, ChatGPT: Write a poem on ChatGPT messing up coding What followed was the highlight of my endeavor: Oh, ChatGPT, the master of words, With language skills beyond compare, But when it comes to coding boards, It struggles to get things square. Its vocabulary is vast and wide, With grammar rules it can abide, Syntax rules though, it cannot hide, It messes up and cannot decide. Lines of code it tries to write, With functions, classes, loops in sight, But when it runs, oh what a fright, It crashes hard, no end in sight. Yet still we love dear ChatGPT, For all the language help it brings, And though its code may faulty be, Its linguistic prowess, heartwarming. With this self-inspective poem by an LLM for a co-author, I rest my case. The complete interaction has been documented on GitHub for those interested in the details. This also includes the complete codes generated by ChatGPT and minute editions by yours truly.


We Train Our Machines, Then They Retrain Us: The Recursive Nature of Building AI

Shaping Our Assistants: Teaching AI Through Human Feedback When OpenAI unveiled GPT-2 in 2019, the natural language model represented a leap forward. Trained on 40 GB of internet text through unsupervised learning, its 1.5 billion parameters could generate remarkably coherent passages. Yet inconsistencies remained. Without human guidance, GPT-2's impressive but aimless prowess produced verbose meanderings as often as useful information. To refine their creation, OpenAI pioneered a new approach: reinforcement learning from human feedback (RLHF). The technique, detailed in the paper "Fine-tuning Language Models from Human Feedback," blends human intuition with AI to steer models toward more "useful" behaviors. Here's how it works: Starting with a base model like GPT-2, human trainers interact with the system, playing both user and AI. This conversation creates a dataset reflecting human preferences. Trainers then further shape the model by ranking its sample responses, allowing a "reward model" to be developed that scores output based on quality. The AI progressively improves by fine-tuning the model to maximize its rewards, generating text more aligned with human values. Through cycles of feedback and refinement, RLHF sculpts once erratic models into more helpful, on-point companions. The fruits of this approach arrived with ChatGPT in 2022. Trained using RLHF, it dazzled users with thoughtful, conversational responses.


The High Cost of Human Wisdom After the breakthrough of ChatGPT, other AI labs quickly adopted reinforcement learning from human feedback (RLHF). Companies like DeepMind, Anthropic, and Meta leaned on RLHF to craft assistants like Sparrow, Claude, and LLaMA-2-chat. Yet while effective, RLHF requires immense resources. Each round involves human trainers generating conversations, evaluating responses, and providing guidance at scale. For GPT-3, OpenAI outsourced this laborious process to contractors in Kenya. The "non-profit's" financial backing enabled this human-powered approach, but such costs limit accessibility for many. Some organizations are getting creative to overcome the hurdle. The Open Assistant Project invites the public to contribute directly to model training through a crowdsourcing platform. DataBricks gamified the process internally, encouraging its 5,000 employees to judge sample interactions through a fun web interface. This allowed them to build the dataset for their own assistant, Dolly rapidly. Startups like Scale AI also offer services to manage the human annotation required for RLHF.