LangChain Update Lets You See What Your Agents are Thinking

Streamlit, a generative AI app development platform, has now been integrated into LangChain, one of the top toolkits of LLM integration. Through this, Streamlit can easily turn data scripts into web applications. For the release of the integration, LangChain showed examples of how the Streamlit callback handler can be used to display the thoughts and actions of agents in an application.

AI agents are all the rage now, and LangChain is also hopping on the trend. This is the latest update to LangChain’s growing set of tools for AI agent creation, this new integration will provide better transparency for developers creating agents.

This integration is sure to give developers a deeper look into the ‘thought processes’ of their AI agents. The GitHub page for the update has a demo that users can try out, which provides a better understanding of what the integration can do. For example, when asked about Leonardo DiCaprio’s current relationship status, the bot shows its ‘thinking process’, as shown below.

With this integration, the agent is now able to show the step-by-step process of how it derives the result for the given question. With the Streamlit integration, developers can make even more powerful agents by getting a better understanding of how they work.

Due to its capabilities to create custom-built AI agents, LangChain is also seeing attention from the developer ecosystem, with Andrew Ng recently releasing a set of courses featuring LangChain. Coupled with this, LangChain is also not slacking, as it keeps updating the toolkits’ capabilities.

Ever since OpenAI introduced the function calling update for the GPT API, LangChain has been updating its capabilities non-stop. Along with their own function calling features, the company also closed a $10 million seed funding round in April.

The post LangChain Update Lets You See What Your Agents are Thinking appeared first on Analytics India Magazine.

Harvard is using ChatGPT to teach computer science

Abstract waves of code

As generative AI continues to disrupt work, education, and life as we know it, one major university is embracing it in all its glory. Harvard University is now using an artificial intelligence tool powered by ChatGPT to help teach beginner computer science courses and simultaneously free up teaching assistants.

Known as the CS50 Bot, the generative AI tool was rolled out to about 70 students this summer as part of the university's introductory class into the Computer Science program as a supportive tool for students.

Also: 7 advanced ChatGPT prompt-writing tips you need to know

The AI chatbot can give students personalized help by understanding their coding challenges with in-depth explanations and providing them with immediate feedback. This prevents students from becoming stuck and discouraged when TAs or professors aren't available. This can result in improved retention rates for both the curriculum and the university.

The AI bot isn't meant to replace teachers or teaching assistants but to "support students as we can through software and reallocate the most useful resources — the humans — to help students who need it most. It's not to reduce the number of teachers but to enhance them," as David Malan, the Gordon McKay Professor of the Practice of Computer Science put it.

Also: Microsoft unveils first professional certificate for generative AI skills

He explained that this is a supportive tool for the students, TAs, and professors alike to make the most of the available resources.

Working with AI is an inevitable part of the future, and this is a tool that could also make the faculty's jobs easier by automating code style improvement suggestions, evaluating code design, troubleshooting issues, and answering the students' frequently asked questions to free up TAs' and professors' time, so they can focus on more interactive and engaging activities with students.

Other institutions have already encouraged the use of AI in the classroom but more are still working towards introducing it. Using AI in Harvard's computer science course could set a standard for the broader adoption of AI in higher education.

Artificial Intelligence

Swiggy Uses Generative AI to Create Mouth-watering Food Images

Food delivery platform Swiggy has started to make use of generative AI, joining the increasing number of companies seeking to enhance customer experiences through products built on this emerging technology, Amitkumar Banka, head growth marketing at Swiggy, told AIM

Banka told AIM that the company is using generative AI to create customised food images based on specific requirements on their platform, and this is helping them serve millions of customers. “We are using generative AI to put the name, description, and image of food items to individual users based on browsing behaviour not only on Swiggy but on the entire internet,” he said.

He further added that teams at Swiggy, including corporate strategy, product design and analytics are coming up with ideas where they can integrate the use of the generative AI at Swiggy. “Each person and team are coming up with their own use cases to take advantage of generative AI,” he said .

Earlier in June, its arch-rival Zomato announced that it is experimenting with generative artificial intelligence (AI). It is said that Zomato has appointed a head of AI product development to drive these efforts and the team at Zomato will be looking to integrate AI into various customer interfacing features such as search and notifications, in addition to backend tools such as product photography, customer support, etc.

Swiggy also recently unveiled a new feature called ‘WhatTo Eat’ that allows users to explore options based on their mood and cravings.

The post Swiggy Uses Generative AI to Create Mouth-watering Food Images appeared first on Analytics India Magazine.

OpenAI Rival Inflection AI Raises $1.3B to Enhance Its Pi Chatbot

OpenAI Rival Inflection AI Raises $1.3B to Enhance Its Pi Chatbot July 3, 2023 by Jaime Hampton

(Ole.CNX/Shutterstock)

Palo Alto-based Inflection AI, an OpenAI competitor, announced it has raised $1.3 billion in a funding round led by Microsoft, Reid Hoffman, Bill Gates, Eric Schmidt, and new investor Nvidia for a total of $1.525 billion raised.

This latest round places the company’s valuation around $4 billion, according to a Reuters report.

Inflection AI claims to be building the largest AI cluster in the world along with partners CoreWeave and Nvidia. When completed, the system will be comprised of 22,000 Nvidia H100 Tensor Core GPUs, a release stated.

“The deployment of 22,000 NVIDIA H100 GPUs in one cluster is truly unprecedented and will support training and deployment of a new generation of large-scale AI models. Combined, the cluster develops a staggering 22 exaFLOPS in the 16-bit precision mode, and even more if lower precision is utilized,” the company said.

The current system contains over 3,500 H100s and recently completed the reference training task of open source benchmark MLPerf in 11 minutes. Inflection AI collaborated with Nvidia and CoreWeave to run the MLPerf tests and fine-tune and optimize the cluster.

The company has developed a large language model, Inflection-1, that enables interaction with Pi, a personal AI chatbot. The company says the new funds will support its continued work of building and supporting Pi. Inflection AI describes Pi as “a new class of AI” designed to be a “kind and supportive companion offering text and voice conversations, friendly advice, and concise information in a natural, flowing style.”

Pi, which stands for “personal intelligence,” is marketed as an AI focused on prioritizing the interests of people both in its functionality and monetization. “Imagine your personal AI companion with the single mission of making you happier, healthier, and more productive,” wrote Mustafa Suleyman, CEO and co-founder of Inflection AI in a blog post.

Instead of the big tech companies prioritizing advertisers and content creators, Inflection AI is trying a different approach, Suleyman says.

“We don’t have all the answers, but we are setting out to develop a personal intelligence that really does work for you, that’s in your corner, always on your team. Our mission is to firmly align your AI with you, and your interests, above all else. It means designing an AI that helps you articulate your intentions, organize your life and be there for you when you need it,” he wrote.

Suleyman, a co-founder of Google’s DeepMind, created Inflection AI in 2022 along with LinkedIn co-founder Reid Hoffman and DeepMind alum Karén Simonyan, Inflection AI’s chief scientist.

The founders have made Inflection AI a public benefit corporation (PBC), which they say gives them a legal obligation to run the company in a way that “balances the financial interests of stockholders, the best interests of people materially affected by our activities, and the promotion of our specific public benefit purpose,” which is to “develop products and technologies that harness the power of AI to improve human well-being and productivity, whilst respecting individual freedoms, working for the common good and ensuring our products widely benefit current and future generations.”

“A powerful benefit of the AI revolution is the ability to use natural, conversational language to interact with supercomputers to simplify aspects of our everyday lives,” said Jensen Huang, founder and CEO of Nvidia in a release. “The world-class team at Inflection AI is helping to lead this groundbreaking work, deploying NVIDIA AI technology to develop, train and deploy massive generative AI models that enable amazing personal digital assistants.”

“We are very excited to partner with Inflection AI, a pioneering AI company with an outstanding team, to bring the power of supercomputing to cutting edge consumer products,” said Michael Intrator, CEO of CoreWeave.

Related

In-Database Analytics: Leveraging SQL’s Analytic Functions

In-Database Analytics: Leveraging SQL's Analytic Functions
Image by Author

We all know the importance of data analysis in today’s data-driven world and how it offers us valuable insights from the available data. But sometimes, data analysis becomes very challenging and time-consuming for the data analyst. The main reason it has become hectic nowadays is the exploded volume of generated data and the need for external tools to perform complex analysis techniques on it.

But what if we analyse data within the database itself and with significantly simplified queries? This can be made possible using SQL Analytic functions. This article will discuss various SQL analytic functions that can be executed within the SQL Server and obtain us valuable results.

These functions calculate the aggregate value based on a group of rows and go beyond basic row operations. They provide us with tools for ranking, time series calculations, windowing and trend analysis. So without wasting any further time, let’s start discussing these functions one by one with some details and practical examples. The pre-requisite of this tutorial is the basic practical knowledge of SQL queries.

Creating a Demo Table

We will create a demo table and apply all the analytic functions on this table so that you easily follow along with the tutorial.

Note: Some functions discussed in this tutorial are not present in SQLite. So it is preferable to use MySQL or PostgreSQL Server.

This table contains the data of several university students, containing four columns Student ID, Student Name, Subject and Final Marks out of 100.

Creating a Students Table containing 4 columns:

CREATE TABLE students    (       id          INT NOT NULL PRIMARY KEY,       NAME        VARCHAR(255),       subject     VARCHAR(30),       final_marks INT    ); 

Now, we will insert some dummy data into that table.

INSERT INTO Students (id, name, subject, final_marks)  VALUES (1, 'John', 'Maths', 89),         (2, 'Kelvin', 'Physics', 67),         (3, 'Peter', 'Chemistry', 78),         (4, 'Saina', 'Maths', 44),         (5, 'Pollard', 'Chemistry', 91),         (6, 'Steve', 'Biology', 88),         (7, 'Jos', 'Physics', 89),         (8, 'Afridi', 'Maths', 97),         (9, 'Ricky', 'Biology', 78),         (10, 'David', 'Chemistry', 93),         (11, 'Jofra', 'Chemistry', 93),         (12, 'James', 'Biology', 65),         (13, 'Adam', 'Maths', 90),         (14, 'Warner', 'Biology', 45),         (15, 'Virat', 'Physics', 56);

Now we will visualize our table.

SELECT *  FROM   students

Output:

In-Database Analytics: Leveraging SQL's Analytic Functions

We are ready to execute the analytic functions.

RANK() & DENSE_RANK()

RANK() function will assign a particular rank to each row within a partition based on the specified order. If the rows have identical values within the same partition, it assigns them the same rank.

Let’s understand it more clearly with the below example.

SELECT *,         Rank()           OVER (             ORDER BY final_marks DESC) AS 'ranks'  FROM   students;

Output:

In-Database Analytics: Leveraging SQL's Analytic Functions

You can observe that the final marks are arranged in descending order, and a particular rank is associated with each row. You can also observe that the students with the same marks get the same rank, and the following rank after the duplicate row is skipped.

We can also find toppers of each subject, i.e. we can partition the rank based on the subjects. Let’s see how to do it.

SELECT *,         Rank()           OVER (             PARTITION BY subject             ORDER BY final_marks DESC) AS 'ranks'  FROM   students;

Output:

In-Database Analytics: Leveraging SQL's Analytic Functions

In this example, we have partitioned the ranking based on subjects and the ranks are allocated separately for each subject.

Note: Please observe that two students got the same marks in the Chemistry subject, ranked as 1, and the rank for the next row directly starts from 3. It skips the rank of 2.

This is the feature of the RANK() function that it is not always necessary to produce ranks consecutively. The next rank will be the sum of the previous rank and the duplicate numbers.

To overcome this problem, DENSE_RANK() is introduced to work similarly to the RANK() function, but it always assigns rank consecutively. Follow the below example:

SELECT *,         DENSE_RANK()           OVER (             PARTITION BY subject             ORDER BY final_marks DESC) AS 'ranks'  FROM   students;

Output:

In-Database Analytics: Leveraging SQL's Analytic Functions
The above figure shows that all the ranks are consecutive, even if duplicate marks are in the same partition. NTILE()

NTILE() function is used to divide the rows into a specified number (N) of roughly equal-sized buckets. Each row is assigned a bucket number starting from 1 to N (Total number of buckets).

We can also apply NTILE() function on a specific partition or order, which are specified in the PARTITION BY and ORDER BY clauses.

Suppose N is not perfectly divisible by the number of rows. Then the function will create buckets of different sizes with the difference of one.

Syntax:

NTILE(n) OVER (PARTITION BY c1, c2 ORDER BY c3)

The NTILE() function takes one required parameter N, i.e. the number of buckets and some optional parameters like PARTITION BY and ORDER BY clause. NTILE() will divide the rows based on the order specified by these clauses.

Let’s take an example considering our “Students” table. Suppose we want to divide the students into groups based on their final marks. We will create three groups. Group 1 will contain the students with the highest marks. Group 2 will have all the mediocre students, and Group 3 will include the students with low marks.

SELECT *,         NTILE(3)           OVER (             ORDER BY final_marks DESC) AS bucket  FROM   students; 

Output:

In-Database Analytics: Leveraging SQL's Analytic Functions

The above example shows that all the rows are ordered by final_marks and divided into three groups containing five rows per group.

NTILE() is useful when we want to divide some data into equal groups according to some specified criteria. It can be used in the applications like customer segmentation based on items purchased or categorizing employee performance, etc.

CUME_DIST()

The CUME_DIST() function finds the cumulative distribution of a particular value in each row within a partition or order specified. Cumulative Distribution Function (CDF) denotes the probability that the random variable X is less than or equal to x. It is denoted by F(x), and its mathematical formula is represented as,

In-Database Analytics: Leveraging SQL's Analytic Functions

P(x) is the Probability Distribution Function.

In simple language, CUME_DIST() function returns the percentage of rows whose value is less than equal to the current row value. It will help to analyze the distribution of data and also the relative position of a value with the set.

SELECT *,         CUME_DIST()           OVER (             ORDER BY final_marks) AS cum_dis  FROM   students; 

Output:

In-Database Analytics: Leveraging SQL's Analytic Functions

The above code will order all the rows based on final_marks and find the Cumulative Distribution, but if you want to partition the data based on the subjects, you can use the PARTITION BY clause. Below is an example of how to do it.

SELECT *,         CUME_DIST()           OVER (             PARTITION BY subject             ORDER BY final_marks) AS cum_dis  FROM   students; 

Output:

In-Database Analytics: Leveraging SQL's Analytic Functions

In the above output, we have seen the cumulative distribution of final_marks partitioned by the subject name.

STDDEV() and VARIANCE()

TheVARIANCE() function is used to find the variance of a given value within the partition. In statistics, Variance represents how a number is far from its mean value, or it represents the degree of spread between numbers. It is represented by ?^2.

The STDDEV() function is used to find the standard deviation of a given value within the partition. Standard Deviation also measures the variation in the data, and it equals the square root of the variance. It is represented by ?.

These parameters can help us to find dispersion and variability in the data. Let’s see how can we do it practically.

SELECT *,         STDDEV(final_marks)           OVER (             PARTITION BY subject) AS marks_stddev,         VARIANCE(final_marks)           OVER (             PARTITION BY subject) AS marks_variance  FROM   students; 

Output:

In-Database Analytics: Leveraging SQL's Analytic Functions
The above output shows the Standard Variation and the Variance of the final marks for each subject. FIRST_VALUE() and LAST_VALUE()

The FIRST_VALUE() function will output the first value of a partition based on a specific ordering. Similarly, the LAST_VALUE() function will output the last value of that partition. These functions can be used when we want to identify the first and last occurrence of a specified partition.

Syntax:

SELECT *,         FIRST_VALUE(col1)           OVER (             PARTITION BY col2, col3             ORDER BY col4) AS first_value  FROM   table_name

Conclusion

SQL Analytic Functions provide us with the functions to perform data analysis within the SQL server. Using these functions, we can unlock the true potential of the data and get valuable insights from it to increase our business. Other than the functions discussed above, there are many more excellent functions that may solve your complex problems very quickly. You can read more about these Analytical Functions from this article by Microsoft.
Aryan Garg is a B.Tech. Electrical Engineering student, currently in the final year of his undergrad. His interest lies in the field of Web Development and Machine Learning. He have pursued this interest and am eager to work more in these directions.

More On This Topic

  • SQL Window Functions
  • 10 Most Used Tableau Functions
  • If You Can Write Functions, You Can Use Dask
  • Loss Functions: An Explainer
  • Statistical Functions in Python
  • What are Moment-Generating Functions?

Humane’s aspiring smartphone-killer ‘Ai Pin’ may be the most 2023 product yet

Humane AI Pin demo on Twitter

A few years ago, when Humane first teased its mission statement and goal of reshaping the role of technology in our lives, there was every reason to be skeptical about the company. The idea of replacing the smartphone and the many other screens that we interact with every day is a big task — and one that the majority may even be against.

Also: AI arms race: This global index ranks which nations dominate AI development

But a quick glance at Humane's roster list, which now includes an ensemble of ex-Apple employees from recruiting to software services, makes it clear that this is no ordinary startup.

Now, the company has announced the name of its first device, Ai Pin, along with a partnership with Qualcomm Technologies to use its chipsets tailored toward AI applications. Generative AI capabilities built locally into devices — and, therefore, don't require a connection to the cloud — is something Qualcomm's been investing heavily in, and may go hand-in-hand with Humane's newest product.

"Humane's Ai Pin will deliver a superior AI experience and feature an assortment of on-device AI capabilities. Its revolutionary and sleek form factor is packed with powerful performance so that it can make sense of real-time contextual information and provide the wearer with a new and exciting experience," says Dev Singh, VP of Business Development at Qualcomm Technologies in a press release.

Also: 7 advanced ChatGPT prompt-writing tips you need to know

I covered Humane's Ai-powered wearable back in April when founder Imran Chaudhri demoed its assistant-like features at TED 2023. The wearable, which fit snuggly in Chaudhri's chest pocket, projected interactive user interfaces onto the palm of his hand, from caller IDs to incoming messages. It could also translate your voice in near real-time, applying an AI filter to replicate your tone and timbre in another language.

That was, of course, just a demo. And how the wearable behaves in real-world scenarios like in between subway stations and areas with little to no cellular service remains untested. The full-length demo of Humane's AI Pin is now available to watch, and we'll be keeping an eye out for when it launches later this year.

Featured

European Union and Japan Explore Strategic Collaboration in AI and Semiconductors

The European Union is seeking to forge a stronger alliance with Japan in pivotal technology sectors such as artificial intelligence (AI), as part of its strategy to lessen dependence on China. EU Commissioner Thierry Breton emphasized this initiative in a recent Twitter video, where he announced that AI would be a high-priority discussion topic in his meeting with the Japanese government.

Breton stated, “I will engage with [the] Japanese government … on how we can organize our digital space, including AI based on our shared value.” His comments suggest an earnest effort to align EU's technological roadmap with Japan, a country known for its robust technology sector.

An EU-Japan Digital Partnership Council and Shared Interests in Semiconductors

The EU and Japan plan to establish a Digital Partnership Council to foster collaboration on quantum and high-performance computing. This follows a similar council formed between the EU and South Korea last week, focusing on AI and cybersecurity.

Breton also revealed plans to cooperate with Japan in the critical semiconductor domain. Semiconductors, the integral components found in a wide range of devices from cars to smartphones, are also pivotal in training AI models. As such, they represent a strategic area of technology where nations strive to position themselves for future advantage.

Japan plays a significant role in the global semiconductor supply chain, and it has been actively working to bolster its domestic industry. In fact, just last week, a fund supported by the Japanese government proposed a $6.3 billion acquisition of domestic chipmaking firm JSR.

The EU, too, has been striving to fortify its semiconductor industry across the bloc. This joint interest in semiconductors could serve as a robust foundation for the proposed EU-Japan technology alliance.

The Broader Picture: De-Risking and Technological Autonomy

The EU's endeavor to solidify partnerships with technologically advanced Asian nations represents a strategic ‘de-risking' from China. Unlike the U.S., which has taken steps to disengage its economy from Beijing, the EU seeks to reallocate risk by deepening technology-related relationships with allied nations.

Simultaneously, the U.S. continues to impose export restrictions on critical technologies, including semiconductors, in an attempt to isolate China. As part of this strategy, Washington has been urging its European allies to follow suit.

Last week, The Netherlands, home to one of the most crucial chip firms, ASML, announced new export restrictions on advanced semiconductor equipment. This development aligns with the broader trend of nations re-evaluating their supply chains and making attempts to bring semiconductor manufacturing back onshore.

The EU's move to collaborate more closely with Japan in key technological areas like AI and semiconductors is a strategic play in the broader geopolitical landscape. It not only seeks to mitigate risks associated with over-reliance on a single nation, but also aims to secure the EU's position in the global technology race.

Why are Companies Creating Specialised Generative AI Roles? 

Coca-Cola recently appointed Pratik Thakkar as its global head of generative AI and PayPal onboarded Vidyut Naware as the head of generative AI centre of excellence. Meanwhile, San Antonio-based multicloud solutions provider, Rackspace Technology, appointed its CTO Srini Koushik as the global head of the company’s newly launched Foundry for Generative AI. And last month, Mphasis announced a dedicated business unit for generative AI, led by the group CTO Anup Nair. But why are we telling you all this? To draw your attention to an emerging trend and an alternative.

So, why is it that companies are setting up specialised roles to drive generative AI initiatives? Is it really necessary, or are companies are just hopping on to the generative AI bandwagon by appointing leaders dedicated to drive their vision?

The Rise of Generative AI Leaders

In the backdrop of Coca-Cola’s Masterpiece ad, it makes sense for the company to elevate Thakkar, who was former head of global creative strategy and content to take up the generative AI global head’s role. In his new role, he would be in charge of leveraging AI technology in creating big ideas and developing marketing strategy across the entire brand and category portfolio of the Coca-Cola Company.

Meanwhile, PayPal’s head of generative AI CoE is looking at using generative AI for risk assessment, customer service, and marketing and automation. PayPal is tackling a slump in customer acquisition since the pandemic and its woes with the stock market crash. The recovery requires the adoption of new AI technologies, said Dan Schulman, president of PayPal.

“We expect AI will allow us to lower the costs for years to come. AI, combined with a unique set of data, will drive efficiencies and a set of value propositions. Despite the fact that today’s environment is difficult to forecast, we are positioned to reap the investments in our products into 2024,” Schulman said at a recent earnings conference. Now, the company is going big on generative AI to save the day.

CTOs Are Enough

Rackspace Technology and Mphasis, on the other hand, have not created a specialised role for taking care of its generative AI initiatives, instead it is primarily led by their chief technology officer (CTO).

Last month, Rackspace announced the launch of Foundry for generative AI by Rackspace or (FAIR), calling the platform “a groundbreaking global practice dedicated to accelerate the secure and sustainable adoption of generative AI solutions across industries”. Its offerings are meant to help organisations identify uses for generative AI, integrate it and optimise its efficiency.

In 2021, Koushik became the CTO of Rackspace, where he was incharge of the company’s strategy and security.

Since then, their AI development has been a combination of open source projects (Hugging Face and stability AI), resources from the acquisition of AI analytics firm Just Analytics and the development of its own generative AI — Intelligent Co-pilot for the Enterprise (ICE), which uses AI to “automate routine tasks, identify warm leads, surface relevant data and content, and provide real-time contextualised analytics for hyper-personalised customer interactions.”

Mphasis went the self reliance route, set up a new division known as Mphasis.ai which offers guidance on the integration of generative AI solutions, create proprietary generative AI technologies, provide licences to more than 250 AI models through its ‘Hyperscaler’ solutions platform, and collaborate with 50 startups to assist clients in solution development. The new vertical will also supply clients with conversational AI tools, such as chatbots, to employ in their businesses. Nair who has been the CTO of Mphasis for seven years now will lead mphasis.ai as its chief architect.

Generative AI Roles Galore

The number of jobs in generative AI has tripled in the last one year, not just in the senior leadership roles but also in the lower and mid levels. With skills from data science, linguistics, analysts, natural language processing and the others in policy which companies are promoting, there are new teams being created that need leadership and specialisation. As per Linkedin, there are close to 846 people with the job role product manager in generative AI.

Large number of companies are quickly adding generative AI features or building their own in creating their own. According to a Goldman Sachs report, a significant increase in the global increase in GDP is brought about by generative AI. Technological innovations are leading to the creation of new occupations, such as model trainers, generative AI architects, AI product managers, generative AI prompt engineers and so on.

So it isn’t surprising that every other company is adopting it without losing time.

The post Why are Companies Creating Specialised Generative AI Roles? appeared first on Analytics India Magazine.

Always Learning: How AI Prevents Data Breaches

Always Learning: How AI Prevents Data Breaches
Photo by Mati Mango

As technology advances, so does how criminals try to exploit it. Today, malicious attacks and data breaches are a significant cause for concern for individuals and organizations. Ransomware, phishing, and malicious insiders are examples of how corporate data can be exposed to threats. To mitigate the impact of these threats, businesses invest in emerging technologies based on the advances of Artificial Intelligence.

How Bad is the Problem?

To understand how bad the problem is with data breaches, it is helpful to look at the key findings of the latest Verizon 2023 Data Breach Investigations Report. According to the report, 74% of the reported breaches involved the human element, while external, financially motivated actors were responsible for 83% of the incidents – which means insiders, both malevolent and unintentional, were responsible for the rest.

Of the reported breaches, 24% were caused due to a ransomware attack, while Business Email Compromise (BEC) frauds were responsible for half of the reported phishing attacks. When data was breached, the top three categories were personal data, login credentials, and internal corporate information like intellectual property and strategic business plans.

If we examine the impact of data breaches, we will realize that the financial burden on businesses is enormous; the average data breach cost was $4.35 million in 2022, indicating a cumulative increase of 12.7% compared to 2020. The most affected sectors were healthcare, finance, pharmaceuticals, energy, and other critical businesses.

The problem becomes more averse as criminals leverage artificial intelligence (AI) tools, like generative AI or large language models (LLM), to craft sophisticated malware and compelling phishing emails which existing security controls cannot detect and mitigate.

How can AI help Prevent Data Breaches?

However, AI is both a curse and a blessing. Although its malevolent use can have detrimental effects on businesses, it can become a savior in the right hands. AI technology utilizes algorithms to analyze data and identify patterns that may signify malicious activity or suspicious behavior. With this information, potential threats can be flagged, and security teams can be alerted to take appropriate action.

There are many ways AI can detect and prevent threats and data breaches.

  • Increase detection accuracy: AI can enhance the precision of malware detection systems by utilizing algorithms that detect patterns in data that could suggest questionable activities.
  • Monitor user activity: By monitoring user behavior across multiple platforms, Artificial Intelligence can identify any suspicious activity, allowing security teams to be alerted before any harmful attacks occur.
  • Update signature-based malware defenses: Updating signature-based malware detection systems can be made more efficient with the help of artificial intelligence. By utilizing advanced algorithms, AI can easily detect new strains of existing malware, preventing malicious actions such as ransomware attacks and minimizing their impact.
  • Identify questionable content: AI can help identify suspicious content, such as phishing links, malicious URLs, or infected attachments, saving you from manually checking their validity. By scanning for such content, security teams can take preventive measures before anyone falls victim to phishing or email-based attacks.
  • Detect zero-day vulnerabilities: AI can also aid in identifying zero-day vulnerabilities. With the help of algorithms, trends in data can be analyzed to predict potential zero-day attacks and isolate them before becoming a real threat.

The Benefits of AI in Data Security

Using AI to identify and prevent threats and data breaches benefits organizations in many ways. First, AI enables security teams to respond swiftly to potential risks to corporate data. These systems continually scan networks and monitor user behavior, alerting the team in real-time of any suspicious activity, increasing, thus, the likelihood of stopping an attack before any data is compromised or stolen.

Secondly, AI provides a more efficient approach to threat response by automating mundane tasks such as malware scanning and identifying malicious URLs. This allows security teams to focus on more critical areas that require greater attention. Eliminating manual jobs from their workflows enables teams to be more effective in detecting and preventing attacks against data, ultimately reducing the number of data breaches and their impact on the organization.

Furthermore, AI can help reduce security costs by minimizing the need for manual labor. By detecting threats early on, these systems can mitigate the damage caused by malicious attacks and reduce the damage caused by data breaches. The IBM Cost of Data Breach report highlights that the sooner a breach is mitigated, the less the overall cost to the affected organization.

Finally, AI can assist security teams in averting future attacks by identifying patterns in data indicative of a potential attack. By learning from past incidents, AI algorithms can help security teams take adequate proactive measures to harden the security of corporate and sensitive data and prevent attacks.

However, organizations should also be aware of certain limitations inherent in AI systems. For example, AI security tools require considerable data to be adequately trained and provide accurate detections and alerts. Otherwise, AI systems can become the source of false positives or may miss specific threats, putting increased pressure on security teams and damaging the security posture. Additionally, training the AI algorithms should be a continuous effort for them to stay effective as the threat landscape changes.

Boost Data Security with AI

In the fight against cybercriminals, artificial intelligence is a valuable ally. Investing in AI for data security and overall business cybersecurity is a wise decision, as it can provide enhanced protection against malicious activity and decrease the chances of data breaches and other cyberattacks. However, just like generative AI cannot replace human creativity, AI security tools cannot (yet) substitute human involvement in cybersecurity.
Anastasios Arampatzis is a retired Hellenic Air Force officer with over 20 years’ worth of experience in managing IT projects and evaluating cybersecurity. During his service in the Armed Forces, he was assigned to various key positions in national, NATO and EU headquarters and has been honoured by numerous high-ranking officers for his expertise and professionalism. He was nominated as a certified NATO evaluator for information security. Currently, he works as a cybersecurity content writer for Bora Design .

More On This Topic

  • A Solid Plan for Learning Data Science, Machine Learning, and Deep Learning
  • Top 2020 Stories: 24 Best (and Free) Books To Understand Machine Learning;…
  • Learning Data Science and Machine Learning: First Steps After The Roadmap
  • AI, Analytics, Machine Learning, Data Science, Deep Learning Research Main…
  • KDnuggets News, June 22: Primary Supervised Learning Algorithms Used in…
  • KDnuggets News, November 2: The Current State of Data Science Careers • 15…

7 advanced ChatGPT prompt-writing tips you need to know

OpenAI logo reflected in human eye

We've discussed how to issue effective prompts in previous articles here on ZDNET.

In this article, we're going to take it up a level and look at more advanced AI prompting techniques. We have seven very interesting approaches that will give you a much better handle on how to communicate with ChatGPT and other generative AI tools.

Also: 6 skills you need to become an AI prompt engineer

Here's how to level up your ChatGPT usage.

1. Specify output format

When you ask a question or give an assignment to ChatGPT, you can specify how it formats the reply. Imagine that you're giving an assignment to a student, where you might specify how the assignment is to be formatted when turned in. Here are a few examples.

What are the longest highways in the United States? List only the top four in the form of a bullet list.

Present that information in a table

2. Tell it to format in HTML

You can specify a lot about how the results are displayed. For example, you can have it generate a table which you can incorporate into a web page.

What are the longest highways in the United States? List only the top four. Present the results as HTML.

You can make that HTML bigger by clicking the square in the upper right corner of the screenshot.

Also: The 10 best ChatGPT plugins (and how to make the most of them)

Here's where it's interesting. You can also have that information presented using whatever style of HTML you like. There's a school of web design that doesn't like the traditional table tags, and prefers to present tables in the form of CSS. Here's that version.

Present that information, but use CSS instead of table tags

3. Iterate with multiple attempts

You often need to work with the AI to help it get to the result you want. Take our previous CSS result. Here's what it looks like:

Unfortunately, that's not as pretty as I'd like. Let's see if we can remedy it.

Redo that, but please make sure the columns are all aligned. Make the headings a darker blue with white lettering presented in all capitals and bold. Make each data row a light gray, but vary the levels of gray so row 1 is light gray, row 2 is slightly darker, row 3 is light gray, and so on. Make sure the highway name is presented in bold.

I'm not going to include the generated code, because it's long. But we're getting closer:

Let's try again.

That output looks really good, but the columns are still not aligned. Make sure the columns are wide enough to accommodate the text without wrapping, left align everything, and make sure all the columns (including the headings) are perfectly aligned.

It's almost exactly what we're looking for, but the route is wrapping. Let's see if we can fix that.

That's almost exactly what I want, but the route is wrapping. Please make sure the route data doesn't wrap either. Keep each line of data on exactly one line.

Don't ever assume this is easy. But if you've ever taught programming to humans, this is exactly the sort of result you get back. It sometimes seems like they're being passive-aggressive, but it's more likely that you didn't specify your requirements carefully enough.

4. Don't be afraid to use long prompts or sets of prompts

It took quite a few iterations to put together a prompt that reliably generated highway information in the format I wanted. One key approach is to make sure your prompt is very specific, but also extensive enough to have enough information for the large language model to fully understand what you're asking.

Also: Microsoft unveils first professional certificate for generative AI skills

You may also need to modify your specification. I wound up removing the line:

Create a table that uses only CSS to format the rows, columns, and cells. Do not use HTML table tags.

Instead, I just told it how I wanted the table to look and let it decide how to implement it. Here's my full, rather long prompt:

I wrote that prompt in Sublime Text, a text editor, and then pasted it into ChatGPT. Here's the result, which is exactly what I wanted.

As you can see, it chose to add a title, which was fine. But now that I have a working prompt, I can add some additional tweaks. For example, I went back and modified the columns specifier:

Create columns for the index number (label this "#"), highway name, length, and route

I tried changing "Limit your answer to only the top four" to "Limit your answer to only the top 20" but the AI refused to fill in all the data for all 20. So I removed that line entirely and added a new line at the very end of the prompt:

For the purpose of this project, please provide full data results for the top 20 highways.

This actually resulted in a partial HTML output. I had to tell the AI to continue, at which point it spit out the rest of the HTML, resulting in this:

5. Provide explicit constraints to a response

You just saw how I modified some response constraints for the number of answers and the columns I wanted presented. But you can use constraints for more open-ended questions as well.

Also: Human or bot? This Turing test game puts your AI-spotting skills to the test

There are limits to this type of prompt. For example, take this prompt:

Provide a summary of the key events in World War II as reported by major newspapers of the time.

Because the model wasn't trained on newspapers from World War II, it's unable to answer the question (although it does take a guess).

Likewise, you can't specify any results from "the last few years" since the model's data entry ends in 2021. That said, you can specify data that's within the scope of the model, like this:

List major space missions between 2010 and 2020

Note that we're limiting by date. But we can add further constraints. Let's limit to just those from the US:

List major space missions conducted by NASA between 2010 and 2020

You can also go back to the formatting approach we discussed and do something like this:

List all major space missions conducted between 2010 and 2020. Group them by nation and space agency. Make the name of the nation and space agency bold.

And you can get even more explicit. Here we include continents and specify that any continents without missions be excluded from the list.

List all major space missions conducted between 2010 and 2020. Group them by continent. Make the name of the continent bold and all capital letters. Make the nation and space agency name bold, with either title case or all caps if that's how the space agency formats its name (like NASA). If a continent did not have a space mission, do not include it on this list.

Interestingly, the AI decided to have a bit of a hallucinatory moment. It properly listed the missions and continents, but decided Russia is a continent. I ran it in a second session, and that time it did not think Russia was a continent.

6. Tell it number of words, sentences, characters

Speaking of constraints, you may have noticed that ChatGPT tends not to be accurate when it comes to word count. If you tell it to limit its answer to 50 words, it sometimes goes long or short. That's because the language model works in tokens (representations of data) that do not directly correspond to individual words.

Also: This AI chatbot sums up PDFs and answers your questions about them

For example, when I told ChatGPT to "Summarize the Game of Thrones TV show," I got back 294 words over six paragraphs. But you can try to limit the response. Try out a variety of limiting terms until you determine what works best for you. For example:

Summarize the Game of Thrones TV series in 50 words

Summarize the Game of Thrones TV series in 2 sentences

Summarize the Game of Thrones TV series in less than 200 characters

Summarize the Game of Thrones TV series so it will fit in a tweet

Here's another place to keep in mind the restrictions of the AI model. ChatGPT contains no training data after 2021. At that time, a tweet was limited to 280 characters. But as of February 2023, Twitter Blue subscribers can have tweets as long as 4,000 characters. Telling ChatGPT to fit something in a tweet tells it to limit the response to 280 characters, because that was the sole limit back in its day.

7. Give the AI the opportunity to evaluate its answers

As we've often discussed, the AI often "hallucinates," providing very wrong answers. It is possible to construct conversations with the AI to arrive at more precise answers, by letting it provide intermediate conclusions. Take this simple request:

Word similar to devolve that begins with a B

As difficult as it might be to imagine, ChatGPT reliably fails with this request, often answering decay, degrade, degenerate and other words that begin with a "D".

There are a couple of challenges with this deceptively simple prompt. First, "devolve" has multiple meanings. It can mean transfer or delegate, deteriorate or decline, or inherit or receive by succession. To get a proper answer, we need to be more specific and give it the general meaning we want it to pursue. It also doesn't hurt to help it determine meaning by telling it we're looking for a verb, rather than a noun.

Generate a verb that starts with the letter "B" and has a similar meaning to "devolve," specifically indicating the idea of something deteriorating or getting worse.

The problem is, ChatGPT has a very difficult time (again, due to how it represents knowledge in tokens) of determining the first letter of a word. So it's best to give the AI time to figure that out.

Determine the first letter of the generated verb

This is what AI experts call "giving it time to breathe". Rather than just rushing out with its first answer, this approach gives the AI time to consider whether its answer is correct.

Also: The best AI art generators

Because the AI may not come up with the right answer the first time, ask it to repeat the steps until it does:

And here, it works its way through until it finds an answer:

Notice how it took the AI six tries before it found the right word, even though the criteria existed for the entire sequence. The second double-check "breathe" gave it the opportunity to evaluate its answer and continue until it succeeded.

Final thoughts

One thing that's really important to note is that the AI won't necessarily do what you want right out of the gate. On the last example, it took me almost two hours and about 20 tries to find the formula that actually worked for it to reliably generate a result.

Also: How I used ChatGPT and AI art tools to launch my Etsy business fast

While we're at it, keep in mind that the AI remembers what went on in the current session. So while it might give you the right answer in the current session, the acid test is copying your prompt to a brand new session and seeing if it works there.

Stay tuned, because not only will I be back with more advanced prompt tips, I'll also be doing some deeper dives into individual prompting problem solvers.

You can follow my day-to-day project updates on social media. Be sure to follow me on Twitter at @DavidGewirtz, on Facebook at Facebook.com/DavidGewirtz, on Instagram at Instagram.com/DavidGewirtz, and on YouTube at YouTube.com/DavidGewirtzTV.

Featured