Self-Attention Guidance: Improving Sample Quality of Diffusion Models

Self-Attention Guidance : Improving Sample Quality of Diffusion Models

Denoising Diffusion Models are generative AI frameworks that synthesize images from noise through an iterative denoising process. They are celebrated for their exceptional image generation capabilities and diversity, largely attributed to text- or class-conditional guidance methods, including classifier guidance and classifier-free guidance. These models have been notably successful in creating diverse, high-quality images. Recent studies have shown that guidance techniques like class captions and labels play a crucial role in enhancing the quality of images these models generate.

However, diffusion models and guidance methods face limitations under certain external conditions. The Classifier-Free Guidance (CFG) method, which uses label dropping, adds complexity to the training process, while the Classifier Guidance (CG) method necessitates additional classifier training. Both methods are somewhat constrained by their reliance on hard-earned external conditions, limiting their potential and confining them to conditional settings.

To address these limitations, developers have formulated a more general approach to diffusion guidance, known as Self-Attention Guidance (SAG). This method leverages information from intermediate samples of diffusion models to generate images. We will explore SAG in this article, discussing its workings, methodology, and results compared to current state-of-the-art frameworks and pipelines.

Self-Attention Guidance : Improving Sample Quality of Diffusion Models

Denoising Diffusion Models (DDMs) have gained popularity for their ability to create images from noise via an iterative denoising process. The image synthesis prowess of these models is largely due to the employed diffusion guidance methods. Despite their strengths, diffusion models and guidance-based methods face challenges like added complexity and increased computational costs.

To overcome the current limitations, developers have introduced the Self-Attention Guidance method, a more general formulation of diffusion guidance that does not rely on the external information from diffusion guidance, thus facilitating a condition-free and flexible approach to guide diffusion frameworks. The approach opted by Self-Attention Guidance ultimately helps in enhancing the applicability of the traditional diffusion-guidance methods to cases with or without external requirements.

Self-Attention Guidance is based on the simple principle of generalized formulation, and the assumption that internal information contained within intermediate samples can serve as guidance as well. On the basis of this principle, the SAG method first introduces Blur Guidance, a simple and straightforward solution to improve sample quality. Blur guidance aims to exploit the benign properties of Gaussian blur to remove fine-scale details naturally by guiding intermediate samples using the eliminated information as a result of Gaussian blur. Although the Blur guidance method does boost the sample quality with a moderate guidance scale, it fails to replicate the results on a large guidance scale as it often introduces structural ambiguity in entire regions. As a result, the Blur guidance method finds it difficult to align the original input with the prediction of the degraded input. To enhance the stability and effectiveness of the Blur guidance method on a larger guidance scale, the Self-Attention Guidance attempts to exploit the self-attention mechanism of the diffusion models as modern diffusion models already contain a self-attention mechanism within their architecture.

With the assumption that self-attention is essential to capture salient information at its core, the Self-Attention Guidance method uses self-attention maps of the diffusion models to adversarially blur the regions containing salient information, and in the process, guides the diffusion models with required residual information. The method then leverages the attention maps during diffusion models’ reverse process, to boost the quality of the images and uses self-conditioning to reduce the artifacts without requiring additional training or external information.

To sum it up, the Self-Attention Guidance method

  1. Is a novel approach that uses internal self-attention maps of diffusion frameworks to improve the generated sample image quality without requiring any additional training or relying on external conditions.
  2. The SAG method attempts to generalize conditional guidance methods into a condition-free method that can be integrated with any diffusion model without requiring additional resources or external conditions, thus enhancing the applicability of guidance-based frameworks.
  3. The SAG method also attempts to demonstrate its orthogonal abilities to existing conditional methods and frameworks, thus facilitating a boost in performance by facilitating flexible integration with other methods and models.

Moving along, the Self-Attention Guidance method learns from the findings of related frameworks including Denoising Diffusion Models, Sampling Guidance, Generative AI Self-Attention methods, and Diffusion Models’ Internal Representations. However, at its core, the Self-Attention Guidance method implements the learnings from DDPM or Denoising Diffusion Probabilistic Models, Classifier Guidance, Classifier-free Guidance, and Self-Attention in Diffusion frameworks. We will be talking about them in-depth in the upcoming section.

Self-Attention Guidance : Preliminaries, Methodology, and Architecture

Denoising Diffusion Probabilistic Model or DDPM

DDPM or Denoising Diffusion Probabilistic Model is a model that uses an iterative denoising process to recover an image from white noise. Traditionally, a DDPM model receives an input image and a variance schedule at a time step to obtain the image using a forward process known as the Markovian process.

Classifier and Classifier-Free Guidance with GAN Implementation

GAN or Generative Adversarial Networks possess unique trading diversity for fidelity, and to bring this ability of GAN frameworks to diffusion models, the Self-Attention Guidance framework proposes to use a classifier guidance method that uses an additional classifier. Conversely, a classifier-free guidance method can also be implemented without the use of an additional classifier to achieve the same results. Although the method delivers the desired results, it is still not computationally viable as it requires additional labels, and also confines the framework to conditional diffusion models that require additional conditions like a text or a class along with additional training details that adds to the complexity of the model.

Generalizing Diffusion Guidance

Although Classifier and Classifier-free Guidance methods deliver the desired results and help with conditional generation in diffusion models, they are dependent on additional inputs. For any given timestep, the input for a diffusion model comprises a generalized condition and a perturbed sample without the generalized condition. Furthermore, the generalized condition encompasses internal information within the perturbed sample or an external condition, or even both. The resultant guidance is formulated with the utilization of an imaginary regressor with the assumption that it can predict the generalized condition.

Improving Image Quality using Self-Attention Maps

The Generalized Diffusion Guidance implies that it is feasible to provide guidance to the reverse process of diffusion models by extracting salient information in the generalized condition contained in the perturbed sample. Building on the same, the Self-Attention Guidance method captures the salient information for reverse processes effectively while limiting the risks that arise as a result of out-of-distribution issues in pre-trained diffusion models.

Blur Guidance

Blur guidance in Self-Attention Guidance is based on Gaussian Blur, a linear filtering method in which the input signal is convolved with a Gaussian filter to generate an output. With an increase in the standard deviation, Gaussian Blur reduces the fine-scale details within the input signals, and results in locally indistinguishable input signals by smoothing them towards the constant. Furthermore, experiments have indicated an information imbalance between the input signal, and the Gaussian blur output signal where the output signal contains more fine-scale information.

On the basis of this learning, the Self-Attention Guidance framework introduces Blur guidance, a technique that intentionally excludes the information from intermediate reconstructions during the diffusion process, and instead, uses this information to guide its predictions towards increasing the relevancy of images to the input information. Blur guidance essentially causes the original prediction to deviate more from the blurred input prediction. Furthermore, the benign property in Gaussian blur prevents the output signals from deviating significantly from the original signal with a moderate deviation. In simple words, blurring occurs in the images naturally that makes the Gaussian blur a more suitable method to be applied to pre-trained diffusion models.

In the Self-Attention Guidance pipeline, the input signal is first blurred using a Gaussian filter, and it is then diffused with additional noise to produce the output signal. By doing this, the SAG pipeline mitigates the side effect of the resultant blur that reduces Gaussian noise, and makes the guidance rely on content rather than being dependent on random noise. Although blur guidance delivers satisfactory results on frameworks with moderate guidance scale, it fails to replicate the results on existing models with a large guidance scale as it gets prone to produce noisy results as demonstrated in the following image.

These results might be a result of the structural ambiguity introduced in the framework by global blur that makes it difficult for the SAG pipeline to align the predictions of the original input with the degraded input, resulting in noisy outputs.

Self-Attention Mechanism

As mentioned earlier, diffusion models usually have an in-build self-attention component, and it is one of the more essential components in a diffusion model framework. The Self-Attention mechanism is implemented at the core of the diffusion models, and it allows the model to pay attention to the salient parts of the input during the generative process as demonstrated in the following image with high-frequency masks in the top row, and self-attention masks in the bottom row of the finally generated images.

The proposed Self-Attention Guidance method builds on the same principle, and leverages the capabilities of self-attention maps in diffusion models. Overall, the Self-Attention Guidance method blurs the self-attended patches in the input signal or in simple words, conceals the information of patches that is attended to by the diffusion models. Furthermore, the output signals in Self-Attention Guidance contain intact regions of the input signals meaning that it does not result in structural ambiguity of the inputs, and solves the problem of global blur. The pipeline then obtains the aggregated self-attention maps by conducting GAP or Global Average Pooling to aggregate self-attention maps to the dimension, and up-sampling the nearest-neighbor to match the resolution of the input signal.

Self-Attention Guidance : Experiments and Results

To evaluate its performance, the Self-Attention Guidance pipeline is sampled using 8 Nvidia GeForce RTX 3090 GPUs, and is built upon pre-trained IDDPM, ADM, and Stable Diffusion frameworks.

Unconditional Generation with Self-Attention Guidance

To measure the effectiveness of the SAG pipeline on unconditional models and demonstrate the condition-free property not possessed by Classifier Guidance, and Classifier Free Guidance approach, the SAG pipeline is run on unconditionally pre-trained frameworks on 50 thousand samples.

As it can be observed, the implementation of the SAG pipeline improves the FID, sFID, and IS metrics of unconditional input while lowering the recall value at the same time. Furthermore, the qualitative improvements as a result of implementing the SAG pipeline is evident in the following images where the images on the top are results from ADM and Stable Diffusion frameworks whereas the images at the bottom are results from the ADM and Stable Diffusion frameworks with the SAG pipeline.

Conditional Generation with SAG

The integration of SAG pipeline in existing frameworks delivers exceptional results in unconditional generation, and the SAG pipeline is capable of condition-agnosticity that allows the SAG pipeline to be implemented for conditional generation as well.

Stable Diffusion with Self-Attention Guidance

Even though the original Stable Diffusion framework generates high quality images, integrating the Stable Diffusion framework with the Self-Attention Guidance pipeline can enhance the results drastically. To evaluate its effect, developers use empty prompts for Stable Diffusion with random seed for each image pair, and use human evaluation on 500 pairs of images with and without Self-Attention Guidance. The results are demonstrated in the following image.

Furthermore, the implementation of SAG can enhance the capabilities of the Stable Diffusion framework as fusing Classifier-Free Guidance with Self-Attention Guidance can broaden the range of Stable Diffusion models to text-to-image synthesis. Furthermore, the generated images from the Stable Diffusion model with Self-Attention Guidance are of higher quality with lesser artifacts thanks to the self-conditioning effect of the SAG pipeline as demonstrated in the following image.

Current Limitations

Although the implementation of the Self-Attention Guidance pipeline can substantially improve the quality of the generated images, it does have some limitations.

One of the major limitations is the orthogonality with Classifier-Guidance and Classifier-Free Guidance. As it can be observed in the following image, the implementation of SAG does improve the FID score and prediction score that means that the SAG pipeline contains an orthogonal component that can be used with traditional guidance methods simultaneously.

However, it still requires diffusion models to be trained in a specific manner that adds to the complexity as well as computational costs.

Furthermore, the implementation of Self-Attention Guidance does not increase the memory or time consumption, an indication that the overhead resulting from the operations like masking & blurring in SAG is negligible. However, it still adds to the computational costs as it includes an additional step when compared to no guidance approaches.

Final Thoughts

In this article, we have talked about Self-Attention Guidance, a novel and general formulation of guidance method that makes use of internal information available within the diffusion models for generating high-quality images. Self-Attention Guidance is based on the simple principle of generalized formulation, and the assumption that internal information contained within intermediate samples can serve as guidance as well. The Self-Attention Guidance pipeline is a condition-free and training-free approach that can be implemented across various diffusion models, and uses self-conditioning to reduce the artifacts in the generated images, and boosts the overall quality.

Top 9 Indian Personalities in AI

While AI takes the world by storm, India has been able to ride the wave, thanks to its vast pool of talented individuals who have been consequential in shaping the industry. From leading research and development for the big techs to running their own AI company, these are the individuals from India to watch out for in AI (in no particular order).

P Anandan

P Anandan stands as a highly esteemed figure with a career spanning over three decades across academia and industry. His expertise lies in the computer vision and artificial intelligence. Anandan began his journey at Microsoft, where he held the position of principal researcher and headed the Interactive Visual Media Research group in Redmond, WA, back in 1997.

His tenure there was marked by significant contributions before he took on the pioneering task of launching Microsoft Research India in December 2004. Anandan’s academic contributions are equally impressive, having been a professor of AI at Yale University and holding a distinguished alumni status at IIT Madras and the University of Massachusetts.

Transitioning to the industry, Anandan served as the vice president for Research at Adobe Systems, bringing his wealth of experience to steer research initiatives. He also held the position as the CEO of the Wadhwani Institute for Artificial Intelligence, a non-profit research institute focusing on leveraging AI for social good.

Anandan’s role as a member of the board of governors at IIT Madras further highlights his continued engagement and commitment to academic advancement and institutional development. His multifaceted journey in academia, research, and industry positions him as a trailblazer in the field of AI.

Kalika Bali

Kalika Bali, a principal researcher at Microsoft Research India, defied conventional advice by dedicating her career to marginalised languages, driven by a vision of inclusive technology access. Her work focuses on ensuring AI development encompassing marginalised languages, notably through gender-intentional datasets for five Indian languages spoken by over a billion people with the Bill & Melinda Gates Foundation.

She aims to eliminate gender biases in AI datasets, fostering unbiased technology engagement.

Bali also explores code-mixing in multilingual communities, aiming to enhance AI tools for these diverse linguistic environments. Her Project Mélange delves into code-mixed language data, vital for natural human-computer interactions and speech technologies. Additionally, she delves into the impact of social and pragmatic factors on language use, seeking to create more socially aware AI.

Bali’s passion lies in NLP and speech technology for Indian languages, aiming to democratise access to technology for millions. Her involvement in government committees highlights her commitment to advancing Indian language technologies and NLP/speech standards.

Bali was also one of the few Indians on the TIME AI 100 list.

Dr Pushpak Bhattacharyya

Dr Pushpak Bhattacharyya stands as a pioneering figure in Indian scientific research, serving as chair professor of computer science and engineering at IIT Bombay. Renowned for guiding over 300 research students, his impact extends beyond academia. He’s held visiting scholar and faculty roles at esteemed institutions like MIT, Stanford, UT Houston, and the University of Joseph Fourier.

Dr Bhattacharyya’s contributions span ML, AI, and NLP, notably reflected in his influential textbook ‘Machine Translation’. With a repertoire of over 350 research papers and three monographs on cutting-edge NLP areas like computational sarcasm and machine translation/transliteration, his work has earned widespread acclaim. His accolades include the Abdul Kalam Technology Innovation National Fellowship, the HH Mathur Research Excellence Award from IIT Bombay, and the VNMM Award by IIT Roorkee.

He chairs the AI Standardisation Committee for the Government of India and holds memberships in distinguished institutions. His deep commitment to NLP and ML is evident through his extensive involvement as program committee chair and reviewer for major conferences in the field, further solidifying his influence and expertise in advancing these domains.

Pushmeet Kohli

Pushmeet Kohli, a principal scientist and VP of research at DeepMind, previously directed research at Microsoft’s Cognition group, holding diverse roles across Microsoft labs globally. His research spans Intelligent Systems and Computational Sciences, focusing on Machine Learning, Computer Vision, Information Retrieval, and Game Theory. Kohli’s research interests span 3D reconstruction, probabilistic programming, interpretable AI, and applications in Healthcare and Virtual/Augmented Reality. Kohli has received several awards, including recognition for his PhD thesis and numerous accolades for his papers presented at various conferences.

Kohli also heads two teams but shows particular enthusiasm for the AI for Science group. AlphaFold, their notable achievement, is used by over a million researchers. It swiftly predicts protein structures from amino-acid sequences, a process formerly taking months or years, revolutionising scientific research in this field. He was also featured on Time’s AI 100 list.

Sunita Sarawagi

Sunita Sarawagi, professor in charge of the centre of machine intelligence and data science at IIT Bombay, holds a PhD from UC Berkeley and boasts four patents. Her research spans sequence models for text and time series, domain adaptation, and enhancing human intervention in learning processes.

Recognised with the Infosys Prize in 2019 for Engineering and Computer Science, she’s also an esteemed IIT Kharagpur distinguished Alumnus awardee. Her extensive publications include best paper awards at prestigious conferences like ACM SIGMOD, VLDB, ICDM, NIPS, and ICML.

Sarawagi has contributed significantly to the field, serving on boards like ACM SIGKDD and VLDB foundation, chairing conferences such as ACM SIGKDD 2008 and co-chairing the research track for VLDB 2011. She’s been involved in program committees for SIGMOD, VLDB, SIGKDD, ICDE, and ICML conferences and served on editorial boards for ACM TODS and ACM TKDD journals. Her professional experience includes impactful roles at Google Research, CMU, and IBM Almaden Research Center.

Vishal Dhupar

Vishal Dhupar has served as NVIDIA’s managing director in South Asia since 2010, leading business operations for the company in the region. In this role, Dhupar is responsible for the development and execution of NVIDIA’s strategic plans in the subcontinent. He is also focused on fostering key partnerships with the ecosystem to accelerate the growth and adoption of GPU technology.

With more than 25 years in the IT industry, Dhupar brings extensive leadership and industry experience.

Before NVIDIA, Dhupar worked at Symantec as managing director of SAARC. He has also worked with Autodesk and Sun Microsystems India. He began his career at DCM Data Products and followed it up with sales positions in Digital Corporation and Silicon Graphics. Dhupar has been the recipient of several performance awards throughout his career in various organisations.

Dr Sanghamitra Bandyopadhyay

Dr Sanghamitra Bandyopadhyay, associated with the Machine Intelligence Unit at the Indian Statistical Institute, has enjoyed an illustrious career. Starting with a PhD from the same institute, she went on to become its director from 2015 to 2020. Her exceptional contributions have garnered prestigious awards such as the Bhatnagar Prize, Infosys Award, TWAS Prize, and DBT National Women Bioscientist Award (Young), among others.

Dr Bandyopadhyay is a member of the Science, Technology, and Innovation Advisory Council of the Prime Minister of India (PM-STIAC), further reflecting her influence in shaping national policies. Her academic portfolio includes over 300 research papers and six edited books, showcasing her expertise in pattern recognition using machine learning, bioinformatics, data mining, and soft and evolutionary computation.

Dr Partha Talukdar

Dr Partha Talukdar is a staff research scientist at Google Research, focusing on graph-based learning algorithms using automated knowledge, temporal information harvesting from large data, and neuro-semantics. He pursued his PhD and postdoctoral studies and went on to work with IISc and Microsoft. His interests lie in natural language processing, machine learning, and knowledge graphs.

Dr Talukdar has co-written a book on graph-based semi-supervised learning, published several research papers, and presented them across India, Italy, Canada, Hong Kong, Japan, the USA, Belgium, Australia, and more.

Dr Soumen Chakrabarti

Dr Soumen Chakrabarti, with over 17 years as a faculty member in IIT Bombay’s Department of Computer Science, has had a distinguished academic career. He obtained his PhD from UC Berkeley and gained valuable experience as a visiting scientist at Google for two years. His current research pursuits revolve around knowledge graphs, complex multimodal question-answering, code-switch text analysis using natural language processing, and searching annotated web content with entities.

His impressive portfolio includes 13 US patents, over 200 research papers, and the authorship of one of the pioneering books on web search and mining. Dr Chakrabarti’s expertise lies in various domains, showcasing his impactful contributions to information retrieval, NLP, and knowledge representation.

The post Top 9 Indian Personalities in AI appeared first on Analytics India Magazine.

GenAI: Beware the Productivity Trap; It’s About Economics – Part 1

Slide1-3

It’s not technology advancements that are the game-changers. The game-changer is how those technological advancements are leveraged to economically transform industries and society.

2024 is going to be a big year, especially in the realm of Artificial Intelligence (AI). Generative AI (GenAI) has lit a fire under organizations that suddenly have a senior management and Board of Directors mandate to “leverage AI to get value from their data.” However, there are two challenges that organizations will face in 2024 to “leverage AI to get value from their data.” And the first step in addressing these two challenges is to realize that this is not a technology challenge. The technology works. Period. No, the two challenges are:

#1) There is too much focus on “implementing AI” and not enough focus on “deriving value from AI.” And that requires first understanding how the organization defines and measures its value-creation processes. Don’t become data-driven or AI-obsessed. Instead, become a value-fanatic!

#2) Empowering the organization to help identify where and how AI and data can be leveraged to create value. That means educating everyone on AI and data literacy so that everyone understands their roles, responsibilities, and rights concerning the meaningful, relevant, responsible, and ethical deployment of AI.

This two-part blog series will highlight the potential of GenAI / AI from an economic perspective. With a focus on economics, the potential for GenAI / AI to transform industries and society is overwhelming. But first, a word of warning…

Beware the Productivity Trap

Beware: faster does not always mean better outcomes. Better means more accurate, more reliable, more responsible, more relevant, and less risky outcomes.

The productivity trap occurs when organizations focus on doing more in less time and with less effort, based on the assumption that productivity is the ultimate goal of an organization. However, this flawed assumption can be dangerous, leading to poor outcomes for the organization and its customers, stakeholders, and constituents. Some of the negative ramifications of the productivity trap include:

  • Increased risk: By not taking the time to thoroughly identify, articulate, and quantify the risks associated with potential failure and potential unintended consequences, organizations may expose themselves to legal, financial, reputational, or operational damages.
  • Reduced accuracy: By trying to make well-defined, accurate decisions and actions quickly, organizations may compromise the quality of their work or ignore important details.
  • Diminished relevance: By neglecting to create a compelling and differentiated relationship with their customers, stakeholders, and constituents, organizations may lose their competitive edge or fail to meet their expectations.
  • Irresponsibility: By doing things faster without full consideration of the actions’ impact on the environment, diversity, and social issues, organizations may harm their social and environmental responsibility.

We can’t become complacent by the GenAI productivity sirens because faster doesn’t always mean better, more accurate, or less risky when reengineering or transforming operational processes and business models. Remember, faster does not equal “better” (Figure 1).

We must adopt a growth mindset to escape the productivity trap. A growth mindset leverages economics and design thinking to empower and unleash the creative juices of the entire organization to identify new sources of wealth or “value” that benefit customers, constituents, and society.

GenAI / AI is an economic opportunity to transform industries and society by creating new methods and models to derive and drive new sources of customer, product, service, and operational value. But first, we must embrace that economic mindset.

Creating the Economic Mindset

Economics is the branch of knowledge concerned with producing, consuming, and transferring wealth or value.

The economic mindset is a way of thinking and acting that focuses on creating new sources of value rather than just doing more things in less time. But do not confuse an economic mindset with a financial mindset.

  • A financial mindset is a way of thinking and acting that focuses on managing money and achieving financial goals.
  • An economic mindset is a way of thinking and acting that focuses on creating and distributing value for customers, stakeholders, and society.

The benefits of an economic mindset include:

  • Constantly striving to blend, bend, and re-engineer to uncover new, innovative ways to create value.
  • Thrive in today’s competitive environment by finding a unique competitive advantage through value-creation creativity and innovation.
  • Prepare for the future by capitalizing on market changes and challenges to identify new models for creating value.
  • Improve organizational performance by optimizing the value-creation resources and processes.
  • Enhance social well-being by balancing profits, operational excellence, environmental impact, society improvements, and ethical treatment.

In the era of Big Data and AI, an economic mindset means embracing new data economic concepts and theorems that can guide organizations in creating these new sources of value, including (Figure 1):

  • Nanoeconomics is the economic theory of individual entity (human or device) predicted behavioral and performance propensities (insights). Nanoeconomics helps organizations understand the behaviors of their customers, stakeholders, machinery, devices, operations, and other entities to deliver more relevant and meaningful outcomes.
  • Data Economic Multiplier Effect is the economic ramifications of accumulating attributable and quantifiable value from reusing a data set against multiple use cases. It shows how data, when properly curated and sharable, exhibits an Economic Multiplier Effect, which is the ratio of the impact of an incremental increase in investment on the resulting incremental increase in output or value.
  • Schmarzo Economic Digital Asset Valuation Theorem determines the value of a data asset based on its reuse across multiple use cases. It states that a data asset’s value increases the more it is reused across multiple use cases and that if the data is “curated” and governed correctly, this reuse comes at near zero marginal cost.
  • Marginal Propensity to Reuse (MPR) explains how data reuse across multiple use cases can increase data value. It is based on the idea that when adequately curated and governed, data never wears out, never depletes, and can be reused across unlimited use cases. The more a data set is reused, the more value it generates for the institution.
Slide2-4

Figure 1: Data Economic Playing Cards

Fueling Economic Transformation

Industry economic transformation leverages innovation (i.e., technology, process, people-based innovation) to re-engineer the economics of an industry by altering industry competition, disrupting traditional business models, and reengineering value creation processes to unleash new sources of value.

History is full of examples of technological advancements that led to economic transformation:

  • Printing press: The printing press transformed the production of books, significantly lowering book production costs while increasing the spread of literacy, education, religion, science, and culture.
  • Internet: The Internet transformed nearly every industry by eliminating time and distance as operational constraints and stimulating new forms of innovation, entrepreneurship, and collaboration that created new industries such as e-commerce, online education, and social media.
  • Personal computing: Personal computing (PCs) transformed the computer industry, significantly reducing computing costs while empowering individuals to create new industries such as software development and digital media creation.

Today, we are witnessing other examples of technology advancements transforming industries:

  • Renewable Energy: Renewable energy is transforming the energy production, distribution, and consumption industries by improving energy security, affordability, and diversity while reducing greenhouse gas emissions, air pollution, noise pollution, and dependence on fossil fuels.
  • Electric Vehicles: Electric vehicles (EVs) are transforming the transportation industry by improving energy efficiency, mobility, and accessibility while reducing greenhouse gas emissions, air pollution, noise pollution, and dependence on oil imports.
Slide3-3

Figure 2: It’s About Economics, Not Technology!

Economics is a powerful force that seeks to balance differing perspectives and rationales to deliver meaningful, relevant, responsible, and ethical organizational and societal outcomes. In today’s digital age, data economics is the “force multiplier” that can take your organization to game-changing levels of performance and innovation.

Summary

It’s not technology advancements that are the game-changers. The game-changer is how those technological advancements are leveraged to economically transform industries and society.

In Part 1, we talked about how to leverage an economic mindset to avoid the productivity trap. We also discussed some critical enabling data economic concepts and how those concepts can take your organization to the next level of game-changing performance and innovation.

In Part 2, we will dive deep into the nanoeconomics concept, the game-changing “force multiplier” that organizations can leverage to economically transform their industry. And we will provide a surprising perspective on GenAI’s role in activating those economic concepts.

How LangChain turns GenAI into a genuinely useful assistant

langchain-breast-ultrasound-application

Using LangChain, programmers have been able to combine ultrasound imaging for things such as breast cancer diagnosis with a ChatGPT-style natural language prompt.

The generative AI movement of OpenAI's ChatGPT and its derivatives is perhaps best known for bad rap lyrics and automated programming assistance. But a new open-source framework riding on top of large language models is bringing a more practical focus to GenAI.

LangChain, just over a year old, is what you could think of as a gentle introduction to programming AI agents through a very simple set of libraries riding on top of GenAI models. The technology is supported by a venture-backed startup of the same name, which offers a server platform for commercial deployment of apps constructed with LangChain.

Also: Generative AI is a developer's delight. Now, let's find some other use cases

The crux of LangChain is that it combines a large language model prompt with various external resources. In this way, it can grab data from a database, for example, and pass language model output to an application, get that app's output and pass it back to the language model, and on and on.

The framework thus allows for the chaining together of resources, where each resource becomes an agent of sorts, handling a piece of the problem within the context of the language model and the prompt.

Already, there are intriguing examples of practical uses from different disciplines.

For example, using LangChain, programmers have been able to combine ultrasound imaging for things such as breast cancer diagnosis with a ChatGPT-style natural language prompt. A radiologist can invoke the computer as an analytical assistant with a phrase such as, "Please give me a summary of given observations depending on probe position" in a breast ultrasound image.

An interesting aspect of the program, built by Jaeyoung Huh and colleagues at the Korea Advanced Institute of Science and Technology, is that it brings together three different neural networks of a widely used variety — ResNet-50 — which is the classic vision neural network that excels at image classification.

Each of the three neural networks is trained separately to perform one task, such as identifying a suspicious form in an ultrasound image, classifying that form, and picking out the location of the form in the body.

The purpose of the LangChain is to wrap these three networks within natural language commands, such as, "give me a probe information for the given image," and then, "give me a summary of given observations."

Also: Pinecone's CEO is on a quest to give AI something like knowledge

At the simplest level, then, LangChain can be a way to create a user-friendly front-end to AI, the kind long dreamed of by specialists in fields such as medical AI who sought to create a doctor's assistant that would respond to spoken commands.

A goal of some LangChain efforts is to try to eliminate GenAI's infamous hallucinations — the programs' propensity to confidently assert false information — by grounding the technology in authoritative external sources. A group at consulting firm Accenture, led by Sohini Roychowdhury, describes a system for making financial predictions via a "finance chatbot."

The system takes cells from a spreadsheet and converts them into natural-language statements about the data, which can then be searched over to find a sentence that matches a question.

Here's how it works: A user prompts the language model with a natural-language question such as, "How are my sales doing?" The prompt is fed into a template that generates a more precise prompt to the language model. That prompt might include more of the detailed question words than a person would think about, to produce a better prompt.

The improved prompt triggers a keyword search, and that search picks out which of the sentences — built from tabular data — point to the most relevant data in the table (e.g., sales, profit).

Once the relevant data is retrieved, a second set of templates helps the chatbot formulate a response to the query using the sentences from the tabular data in a chat response.

Also: Microsoft's GitHub Copilot pursues the absolute 'time to value' of AI in programming

Roychowdhury and team don't manage to eliminate hallucinations. Instead, they designed a "confidence" scoring mechanism by which the chatbot checks its answers against the question, sees how well they match, and then assigns a confidence score of high, medium or low for its answer.

"The confidence score tells the user to assert caution while making key decisions using medium to low confidence responses," explains Roychowdhury. "The confidence score further helps ascertain which user queries need to be further refined for reliability."

Programmers are finding that a LangChain can be a way to automate some extremely mundane tasks. One example is checking employees' Web usage to make sure they are not browsing illicit Web sites. A document describing an "acceptable use policy" for a corporation is uploaded into what's called a vector database, a special kind of database that can compare text strings from, say, a URL to a collection of text strings in a document to see if there's a match.

When a person types a URL into a browser, both the URL of the site and the summary of the site's content can be automatically compared to the policy document in the vector database to see if the site's content matches any prohibited topics. The programmer can automate the comparison with a simple text prompt, asking, "Does anything in this site match prohibited items?"

Also: I took this free AI course for developers in one weekend and highly recommend it

Such an example makes clear that large language models and LangChain are moving beyond individuals' queries. They are becoming a way for programmers to use natural language commands to integrate the various tools at their disposal for functions that are behind the scenes.

LangChain is not the only framework for compiling workflows that have an agent quality, and more such frameworks are being created, including Microsoft's Semantic Kernel and the open-source LlamaIndex, which builds upon LangChain.

A group of scholars at Stanford, UC Berkeley and Carnegie Mellon, along with collaborators from private industry, in October introduced what they call DSPy, which is a programming approach that replaces hand-coded natural language prompts with functional descriptions and can in turn automatically generate prompts. The functional descriptions can be very broad, such as, "consume questions and return answers." DSPy features a compiler to optimize the flow of language models and supporting tools.

The DSPy effort is analogous, the authors note, to deep learning frameworks that have advanced neural networks via layers of abstraction, including Torch and Theano.

Also: 8 ways AI and 5G are pushing the boundaries of innovation together

The authors claim dramatic improvements in quality over having a person manually craft a prompt in each instance. "Without hand-crafted prompts and within minutes to tens of minutes of compiling, compositions of DSPy modules can raise the quality of simple programs from 33% to 82%," they write.

It's very early days in the GenAI framework game, and you can expect many more layers of abstraction on top of, underneath, and around LangChain in the coming year.

Artificial Intelligence

8 On-Point AIM Forecasts of 2023

The year 2023 unfolded like a tech thriller, with generative AI captivating everyone from corporations to our next-door neighbours. In an annual tradition, Analytics India Magazine (AIM) laid down the markers for the tech trajectory in India and across the globe.

The Top Data Science & AI Trends for 2023 report is a detailed guide for industry insiders and newbies to understand the markets and how to move forward. Here are eight on-point predictions made by the team in 2022, which came true in 2023.

Recession significantly impacted the hiring of data professionals

As per AIM Research’s job tracker, which aggregates information about data science and analytics job listings from various online platforms, India witnessed a decrease in the overall number of data science and analytics job opportunities in the past year.

While roles in the energy and utilities sector decreased compared to 2022, those in retail & consumer packaged goods (CPG) and pharma & healthcare saw an increase.

Legality of data privacy gained prominence

Safety and the risk issue around AI became a significant part of the public agenda in 2023 all around the world. In India, new data privacy and storage laws were enacted to safeguard users.

Tech giant Google stepped up its efforts to address this issue with valuable security with the Dark Web Report, which will allow Indians to closely monitor their personal information on the dark web, a hub for illicit activities such as the trading of sensitive personal data.

Big IT started automating internal processes with Gen AI

IT leaders across the globe have long known that AI-powered automation is essential for survival in a digitally driven economy; the initial steps were visible in 2023. While some companies have hesitated to adopt the new human-mimicking technology, most have tried to embrace it as a workflow tool.

One well-known example is of Salesforce deploying Einstein Copilot to auto-generate email replies and account updates based on a customer’s specific context.

CDOs became more critical for collaboration

According to the Deloitte Chief Data Officer survey of 2023, the role of CDOs became increasingly important in most organisations, with 61% of CDOs stating that creating, updating, or implementing their data strategy became their top priorities.

As per the latest report, generative AI has created a halo effect for CDOs, opening up their peers and boards to talk about topics they might have previously shied away from.

Most CDOs recognise that foundational data quality and good use cases are fundamental challenges that must be overcome to take advantage of the technology. Moving ahead, 93% of CDOs believe a practical data strategy is needed if organisations are to succeed with generative AI.

Cloud computing and multi-cloud became a big part of the IT strategy

The cloud revolution gained more momentum in 2023. It emerged as an equaliser for all sizes of businesses, from global enterprises to startups, offering a field to innovate and optimise workloads. Large enterprises harnessed the cloud to streamline operations, enhance scalability, and reduce costs while using generative AI.

The year also saw a rise in businesses born out of the cloud. China’s Alibaba Cloud rolled out Tongyi Qianwen in April to run applications across its ecosystem on the large language model.

Data scientists’ started focusing on software

There was an unspoken war waging amongst the tech companies regarding data collection and wrangling. Naturally, the ability to process data in huge chunks became critical for data scientists. The volume of data grew at an exponential rate, and being able to handle and analyse it became necessary.

A study demonstrated that data scientists were in most demand in IT and tech, accounting for 49% of the job postings on LinkedIn.

Citizen data scientists to grow due to no-code, low-code platforms

Programming became a cakewalk with AI-powered coding assistants and also with low-code/no-code, allowing citizens to build applications for business usage. The global low-code and no-code market was valued at nearly $15 billion according to the ISG Information Services Group.

Gartner predicts that 70% of new applications will be developed using no-code or low-code frameworks by 2025. These platforms help reduce app development time by 90% and empower non-developers to delve into app development regardless of their technical background.

Generative AI will become more powerful and accessible

AI officially became the year’s word, thanks to generative AI. The popularity and mainstream usage of generative AI services have expanded exponentially in 2023, as we saw every second company in tech and across all industries rushing to embrace the tech.

Apart from internally implementing the tech, the companies put efforts into making the tech available to the general public through waitlists, APIs and open-source projects. McKinsey reported that while overall AI adoption remains steady at around 55%, more than two-thirds of respondents say their companies plan on using generative AI.

Furthermore, four in five online teenagers aged 13-17 now use generative AI tools and services.

The post 8 On-Point AIM Forecasts of 2023 appeared first on Analytics India Magazine.

Indian AI and Robotics Startup Claims Level 5 Autonomy 

Indian autonomous driving company Swaayatt Robots has announced that it achieved the world’s first Level 5 autonomous driving capability. In the demonstration, its autonomous vehicle i.e, Mahindra Bolero, learned to negotiate complex traffic dynamics in the Toll-Plaza and successfully crossed highly unstructured toll-gates.

The company said that this achievement, second only to previous demos in 2017 and 2023, signifies a significant leap in Level-5 capabilities. The team enabled autonomous driving to negotiate tight and dynamic adversarial environments using multi-reinforcement learning agents. Notably, the demo on October 22, 2023, involved bidirectional traffic negotiation on single-lane roads.

Swayaatt Robots posted a video which displays the vehicle entering the toll-gate region through a highway, navigating bidirectional traffic dynamics in an open area without strict driving rules. The complexity is heightened by randomly parked trucks, a common occurrence in Toll-Plaza areas, and the vehicle’s ability to decide which toll-gate-passage to commit to while avoiding overtaking trucks.

To illustrate the complexity, a tractor tire was placed behind a large 18-wheeler truck, testing the vehicle’s capability to detect obstacles at night. Impressively, the vehicle successfully negotiated this scenario while another truck overtook from the right.

The vehicle demonstrated advanced decision-making and motion planning algorithms, crucial for navigating such intricate scenarios. The team emphasized the scalability of this framework with unsupervised deep learning and teased an upcoming showcase in February, promising an end-to-end negotiation of daytime traffic.

Notably, the vehicle slowed and paused approaching a speed-breaker, aligning itself on-the-fly with the selected toll-gate, adhering to driving rules and speed limits. The system even adapted to unexpected obstacles, such as a broken traffic-police barricade, showcasing a robust and adaptive autonomous driving system.

Interestingly, Tesla cars currently fall under Level 2 of the six levels of vehicle automation defined by the Society of Automotive Engineers (SAE).

The post Indian AI and Robotics Startup Claims Level 5 Autonomy appeared first on Analytics India Magazine.

Food Delivery Apps Get an AI Agent

Llama Index recently introduced a full-stack repository by lucastonon, unveiling a Context-Augmented Agent for Food Delivery. This autonomous agent, dubbed the “Interface-Omniscient” Agent, is set to transform the food ordering landscape, offering a streamlined and hands-free experience.

Lucastonon’s repository introduces the RAG agent, showcasing its ability to effortlessly handle tasks such as looking up restaurants, opening pages, fetching menus, and adding items to the cart. The agent serves as an interface maestro, simplifying complex interactions on a website.

The core concept revolves around empowering an autonomous chatbot, the Interface-Omniscient Agent, with the capability to navigate websites effortlessly. It accomplishes this through a multifaceted approach:

Intuitive Page Interaction: The agent can open pages and click on buttons by understanding the elements within the page.

Contextual Information Delivery: Providing users with real-time information about the current page, the agent enhances user understanding and decision-making.

Action Tracking for Informed Decisions: By tracking user actions, the chatbot can make informed decisions, ensuring a seamless and personalized experience.

The demonstration showcases practical applications. Users can autonomously order food using voice commands, eliminating the need to navigate complex interfaces. The chat assistant responds autonomously through voice, enhancing user convenience.

In India, food delivery apps Swiggy and Zomato have recently been experimenting with generative AI. This development not only introduces an advanced agent for food delivery but also redefines user interactions online. The Interface-Omniscient Agent promises a smoother, hands-free online experience, setting the stage for a new era of intuitive navigation.

The post Food Delivery Apps Get an AI Agent appeared first on Analytics India Magazine.

This company’s AI FinOps serves Snowflake, Databricks & more

With the global cloud FinOps market expected to grow from $832.2 million in 2023 to $2,750.5 million by 2028, with an average annual growth rate of 18.8%, companies offering data observability and FinOps have found rising prevalence in the market. One such player who has been in the market for over a decade, leveraging machine learning and automation to provide services to some of the biggest cloud players such as Databricks, Snowflake, Big Query and others is Unravel Data.

AI is Not New

Using AI-powered tools and an insights engine, this US-based company which also has an office in Bengaluru, has been relying on in-house ML models and algorithms. “AI is not new to Unravel. We have used AI to automate tasks for data teams over the last 10 years after observing more than 50 million data pipelines and queries. Today, AI is woven into Unravel’s platform at all levels,” said Kunal Agarwal, CEO and co-founder of Unravel Data, in an exclusive interaction with AIM.

Unravel Data’s ML algorithms have been developed in-house and have been trained across a wide variety of workloads for each specific platform to ensure maximum accuracy in insights and predictions. The company’s AI-powered Insights Engine utilises a robust tech stack that starts with data collection from diverse sources, covering big data application performance, cloud expenses and historical usage patterns.

While AI has been the core of Unravel’s business functioning, generative AI is not far behind. Speaking about its implementation, Agarwal mentioned that Unravel has big plans with it and will be shared with the market very soon.

Customer-Centric Solutions

Increasing adoption of data engineering teams that are guided by DataOps practices will lead to fruitful results. By 2025, data teams supported by dataops tools and practices are said to be 10 times more productive than teams that don’t use Data Ops. With the need to stand apart and offer specialised solutions, Unravel has addressed that as well.

“The AI isn’t just reactive; it employs predictive analytics, forecasting future cloud spending based on historical data and trends. This foresight empowers businesses to make proactive adjustments, avoiding budgetary pitfalls. This also means that our ML models are trained for each specific platform, across a wide variety of workloads to provide accurate insights,” said Agarwal.

Catering to specific needs, Unravel has distinguished products for each of their big customers including Databricks, AWS’ EMR and others. Unravel’s purpose-built AI provides insights in real time at the job, user, and workgroup levels to help teams improve their cost allocation and workload efficiency. Furthermore, a standout feature of Unravel’s Insights Engine is its ability to act as a financial detective. It scrutinises cloud spending patterns, identifying anomalies and inefficiencies in resource allocation. “This is invaluable for organisations aiming to streamline costs and enhance operational effectiveness,” said Agarwal.

Agarwal believes that the AI-driven resource rightsizing recommendations are akin to having a personal trainer for one’s cloud resources. “Unravel Data ensures that your resources are neither underutilised nor oversized, optimising costs with precision. The AI also plays a crucial role in cost allocation, accurately attributing cloud costs to different business units or projects.”

Data Observability in 2024

With booming predictions for cloud end-user spending which was expected to hit $600 billion in 2023 as per Gartner, the forecast is only going to hit higher, thereby spiking the need for data observability and FinOps platform.

“In 2024 (and beyond) cloud data costs are going to be much higher because you’re gathering, retaining, and processing more data. Data observability to understand what’s going on with data applications/pipelines will become table stakes. What companies will really need are solutions that leverage data observability with FinOps and AI-powered recommendations that optimise performance and costs of data workloads,” said Agarwal. However, challenges of navigating around generative AI in FinOps will continue.

“The total impact, both fiscal and environmental, will have companies putting greater scrutiny on their AI projects, such as which models do they really need to run, which projects needs generative AI, can a model be repurposed/fine-tuned as opposed to starting from scratch, and rightsizing jobs to ensure that they’re wasting neither resources nor money,” said Agarwal, who believes these are some of the nuances that needs to be dealt with.

Companies such as Dynatrace, Datadog, Microsoft System Centre among others are some of the notable competitors to Unravel Data.

The post This company’s AI FinOps serves Snowflake, Databricks & more appeared first on Analytics India Magazine.

Prompt Engineering 101: Mastering Effective LLM Communication

Prompt Engineering 101: Mastering Effective LLM Communication
Image created by Author with DALL•E 3
Introduction

Prompt engineering, like language models themselves, has come a long way in the past 12 months. It was only a little over a year ago that ChatGPT burst onto the scene and threw everyone's fears and hopes for AI into a supercharged pressure cooker, accelerating both AI doomsday and savior stories almost overnight. Certainly, prompt engineering existed long before ChatGPT, but the range of ever-changing techniques we use for eliciting desired responses from the plethora of language models that now invade our lives has really come into its own alongside the rise of ChatGPT. Five years ago with the unveiling of the original GPT we joked about how "prompt engineer" could one day become a job title; today, prompt engineers are one of the hottest tech (or tech adjacent) careers out there.

Prompt engineering is the process of structuring text that can be interpreted and understood by a generative AI model. A prompt is natural language text describing the task that an AI should perform.

From the "Prompt engineering" Wikipedia entry

Hype aside, prompt engineering is now an integral part of the lives of those interacting with LLMs on a regular basis. If you are reading this, there's a good chance this describes you, or describes the direction that your career may be taking. For those looking to get an idea of what prompt engineering is, and — crucially — what the current prompt strategy landscape looks like, this article is for you.

Getting Started

Let's start with the basics. This article, Prompt Engineering for Effective Interaction with ChatGPT, on Machine Learning Mastery covers the prompt engineering foundational concepts. Specifically, topics introduced include:

  • Principles of Prompting, outlining several foundational techniques to remember in the process of prompt optimization
  • Basic Prompt Engineering, such as prompt wording, succinctness, and positive and negative prompting
  • Advanced Prompt Engineering Strategies, including one-shot and multi-shot prompting, Chain-of-Thought prompting, self-criticism, and iterative prompting
  • Collaborative Power Tips for recognizing and fostering a collaborative atmosphere with ChatGPT to lead to further success

Prompt engineering is the most crucial aspect of utilizing LLMs effectively and is a powerful tool for customizing the interactions with ChatGPT. It involves crafting clear and specific instructions or queries to elicit the desired responses from the language model. By carefully constructing prompts, users can guide ChatGPT’s output toward their intended goals and ensure more accurate and useful responses.

From the Machine Learning Mastery article "Prompt Engineering for Effective Interaction with ChatGPT"

Once you have covered the basics, and have a taste for what prompt engineering is and some of the most useful current techniques, you can move on to mastering some of those techniques.

Prompt Engineering Techniques Deep Dive

The following KDnuggets articles are each an overview of a single commonplace prompt engineering technique. There is a logical progression in the complexity of these techniques, so starting from the top and working down would be the best approach.

Each article contains an overview of the academic paper in which the technique was first proposed. You can read the explanation of the technique, see how it relates to others, and find examples of its implementation all within the article, and if you are then interested in reading or browsing the paper it is linked to from within as well.

Unraveling the Power of Chain-of-Thought Prompting in Large Language Models

This article delves into the concept of Chain-of-Thought (CoT) prompting, a technique that enhances the reasoning capabilities of large language models (LLMs). It discusses the principles behind CoT prompting, its application, and its impact on the performance of LLMs.

Exploring Tree of Thought Prompting: How AI Can Learn to Reason Through Search

New approach represents problem-solving as search over reasoning steps for large language models, allowing strategic exploration and planning beyond left-to-right decoding. This improves performance on challenges like math puzzles and creative writing, and enhances interpretability and applicability of LLMs.

Automating the Chain of Thought: How AI Can Prompt Itself to Reason

Auto-CoT prompting method has LLMs automatically generate their own demonstrations to prompt complex reasoning, using diversity-based sampling and zero-shot generation, reducing human effort in creating prompts. Experiments show it matches performance of manual prompting across reasoning tasks.

Parallel Processing in Prompt Engineering: The Skeleton-of-Thought Technique

Explore how the Skeleton-of-Thought prompt engineering technique enhances generative AI by reducing latency, offering structured output, and optimizing projects.

Unlocking GPT-4 Summarization with Chain of Density Prompting

Unlock the power of GPT-4 summarization with Chain of Density (CoD), a technique that attempts to balance information density for high-quality summaries.

Unlocking Reliable Generations through Chain-of-Verification: A Leap in Prompt Engineering

Explore the Chain-of-Verification prompt engineering method, an important step towards reducing hallucinations in large language models, ensuring reliable and factual AI responses.

Graph of Thoughts: A New Paradigm for Elaborate Problem-Solving in Large Language Models

Discover how Graph of Thoughts aims to revolutionize prompt engineering, and LLMs more broadly, enabling more flexible and human-like problem-solving.

Thought Propagation: An Analogical Approach to Complex Reasoning with Large Language Models

Thought Propagation is a prompt engineering technique that instructs LLMs to identify and tackle a series of problems that are similar to the original query, and then use the solutions to these similar problems to either directly generate a new answer or formulate a detailed action plan that refines the original solution.

Additional Resources

While the above should get you to a spot where you can begin engineering effective prompts, the following resources may provide some additional depth and/or alternative views that you might find helpful.

Mastering Generative AI and Prompt Engineering: A Practical Guide for Data Scientists [eBook] from Data Science Horizons

The ebook provides an in-depth understanding of generative AI and prompt engineering, covering key concepts, best practices, and real-world applications. You’ll gain insights into popular AI models, learn the process of designing effective prompts, and explore the ethical considerations surrounding these technologies. Furthermore, the book includes case studies demonstrating practical applications across different industries.

Mastering Generative AI Text Prompts [eBook] from Data Science Horizons

Whether you’re a writer seeking inspiration, a content creator aiming for efficiency, an educator passionate about knowledge sharing, or a professional in need of specialized applications, Mastering Generative AI Text Prompts is your go-to resource. By the end of this guide, you’ll be equipped to harness the power of generative AI, enhancing your creativity, optimizing your workflow, and solving a wide range of problems.

The Psychology of Prompt Engineering [eBook] from Data Science Horizons

Our ebook is packed with captivating insights and practical strategies, covering a wide range of topics such as understanding human cognition and AI models, psychological principles of effective prompts, designing prompts with cognitive principles in mind, evaluating and optimizing prompts, and integrating psychological principles into your workflow. We’ve also included real-world case studies of successful prompt engineering examples, as well as an exploration of the future of prompt engineering, psychology, and the value of interdisciplinary collaboration.

Prompt Engineering Guide from DAIR.AI

Prompt engineering is a relatively new discipline for developing and optimizing prompts to efficiently use language models (LMs) for a wide variety of applications and research topics. Prompt engineering skills help to better understand the capabilities and limitations of large language models (LLMs).

Prompt Engineering Guide from Learn Prompting

Generative AI is the world's hottest buzzword, and we have created the most comprehensive (and free) guide on how to use it. This course is tailored to non-technical readers, who may not have even heard of AI, making it the perfect starting point if you are new to Generative AI and Prompt Engineering. Technical readers will find valuable insights within our later modules.

Conclusion

Prompt engineering is a must-have skill for both AI engineers and LLM power users. Beyond this, prompt engineering has flourished into an AI niche career in its own right. There is no telling what the exact role for prompt engineering — or if dedicated prompt engineer roles will continue to be sought after AI professionals — but one thing is clear: knowledge of prompt engineering will never be held against you. By following the steps in this article, you should now have a great foundation to engineering your own high-performance prompts.

Who knows? Maybe you're the next AI whisperer.

Matthew Mayo (@mattmayo13) holds a Master's degree in computer science and a graduate diploma in data mining. As Editor-in-Chief of KDnuggets, Matthew aims to make complex data science concepts accessible. His professional interests include natural language processing, machine learning algorithms, and exploring emerging AI. He is driven by a mission to democratize knowledge in the data science community. Matthew has been coding since he was 6 years old.

More On This Topic

  • Some Kick Ass Prompt Engineering Techniques to Boost our LLM Models
  • Mastering Generative AI and Prompt Engineering: A Free eBook
  • Data Visualization Best Practices & Resources for Effective Communication
  • Web LLM: Bring LLM Chatbots to the Browser
  • The Art of Prompt Engineering: Decoding ChatGPT
  • The Rise and Fall of Prompt Engineering: Fad or Future?

MosaicML Announces Beyond Chinchilla-Optimal for LLM Scaling Laws in Inference

MosaicML has unveiled its latest research, titled “Beyond Chinchilla-Optimal: Accounting for Inference in Language Model Scaling Laws.” This paper challenges existing paradigms in large language model (LLM) scaling laws, introducing a novel approach that incorporates the often-overlooked factor of inference cost.

Click here to read the paper.

Traditionally, LLM scaling laws, such as the widely-used DeepMind Chinchilla scaling laws, have focused solely on estimating changes in model quality based on increased parameter count and training data. However, MosaicML’s research highlights a critical gap in these formulas by neglecting the crucial aspect of inference cost.

The core innovation lies in the modification of the Chinchilla scaling laws to calculate the optimal LLM parameter count and pre-training data size. This calculation considers the dual aspects of training and deploying a model of a specified quality while meeting the demands of inference. The researchers conducted a comprehensive analysis, factoring in both computational budgets and real-world costs.

Key findings from the study include:

  • Cost-Effective Training: MosaicML’s approach enables training a large language model from scratch for less than $100, offering a cost-effective alternative for researchers and organisations.
  • Encoder Architecture: The model introduced in the research is an encoder (BERT-like) rather than a decoder. This move underscores the ongoing significance of encoder-only models, with the authors expressing satisfaction at the integration of recent LLM advances into BERT-like architectures.

The modification of the Chinchilla scaling laws is crucial for accurately reflecting the practical challenges faced by LLM researchers. The researchers emphasise that their analysis applies not only in terms of a compute budget but also in real-world scenarios where costs and demands for inference are substantial.

Zhang Peiyuan made TinyLlama breaking laws of scalability as well. The research assistant at Singapore University, had trained a 1.1 billion parameter model called TinyLlama. Based on Llama 2, the ambitious part about this project is that Peiyuan aims to pre-train it on 3 trillion tokens.

As the inference demand approaches pre-training data size, the research indicates a shift in the optimal parameters-to-tokens ratio towards smaller and longer-trained models. However, the authors acknowledge the need for further experimental validation to ascertain the applicability of their formulas, especially in extreme ranges where pre-training tokens exceed model parameters by orders of magnitudes.

The post MosaicML Announces Beyond Chinchilla-Optimal for LLM Scaling Laws in Inference appeared first on Analytics India Magazine.