5 emerging use cases of generative AI in commerce, according to Mastercard

Shopping carts in a trend line up

Generative AI can transform how different industries operate, including commerce. As a result, Mastercard released a Signals report on what commerce looks like in the age of generative AI, and here are some of the key insights.

Technology like ChatGPT can transform commerce in different areas, including knowledge distribution, HR and training, code writing, legal, cybersecurity, treasury, marketing, customer interfaces, and service delivery, according to Mastercard.

Also: We're not ready for the impact of generative AI on elections

For that reason, companies are adopting AI at higher rates than they had in the past, with 50% of companies reporting using AI for at least one application in 2022 compared to just 20% in 2017, according to the report.

"Over the next two to three years, generative AI will power hundreds of capabilities across business and consumer applications," said Mastercard.

Specifically, the company identified five emerging use cases where AI could be implemented to optimize different commerce sectors, including enterprise, finance, small business, retail, and travel.

Also: How to block OpenAI's new AI-training web crawler from ingesting your data

AI can help enterprises by distributing company knowledge and insights across organizations in real time, regardless of organization size.

The report suggests replacing traditional enterprise search engines, which can be overwhelming due to their vast resources, with a generative AI search engine. This would allow employees to find the exact answer with just one prompt.

The finance industry can benefit from AI by leveraging generative AI's quantitative abilities to simplify complex tasks such as wealth management.

Specifically, the report outlines how generative AI can streamline and declutter processes such as interacting with different banks, insurance companies, and other institutions by acting as a personal wealth manager.

Also: How to achieve hyper-personalization using generative AI platforms

With the proper data protections, generative AI can be directly integrated into bank accounts, investment portfolios, and more to have an encompassing view of an individual's financial life and assist accordingly.

For small businesses, AI can help unlock new capabilities by doing tasks that entrepreneurs and small business owners wouldn't typically have the bandwidth for. These tasks range from creating a marketing campaign to helping build prototype apps.

One way AI can help retail is through the use of AI-powered personal shoppers. As the report highlights, there are so many online shopping options that it can sometimes become overwhelming for users.

An AI-powered personal shopping consultant would assist users with finding precisely what they need while connecting them to retail offers they may have otherwise missed.

Also: This retailer is using RFID tags to make in-person clothes shopping less frustrating

Shopify, Google, and Amazon are examples of companies already working on such integrations.

Lastly, AI could optimize the travel industry by acting as a travel agent and helping travelers make educated trip-planning decisions with ease. Travel platforms are already working on this type of experience for customers.

ChatGPT expands its ‘custom instructions’ feature to free users

ChatGPT expands its ‘custom instructions’ feature to free users Sarah Perez @sarahintampa / 9 hours

OpenAI announced that it’s expanding custom instructions — a way to give users more control over how ChatGPT responds — to all users, including those on the free tier of the service. The feature, which was first unveiled in July as a beta for ChatGPT Plus subscribers, allows users to add various preferences and requirements that they want the AI chatbot to consider when responding.

The feature can save users time, so they don’t have to rewrite the same instruction prompts every time they interact with the chatbot, as TechCrunch previously explained.

For example, you could ask ChatGPT to keep its answers to a specific character count or customize the tone of the response it provides.

With the feature’s July debut, OpenAI also offered an example of a teacher using ChatGPT to create a lesson plan would no longer have to constantly repeat that they teach 3rd grade to receive an appropriately customized response.

Meanwhile, developers using the feature could ask the chatbot to provide responses in languages they prefer — or eliminate those they don’t.

“Through our conversations with users across 22 countries, we’ve deepened our understanding of the essential role steerability plays in enabling our models to effectively reflect the diverse contexts and unique needs of each person,” the company earlier said.

However, until this week, custom instructions were limited to those who pay for a ChatGPT Plus subscription, at a cost of $20 per month. Now, the option will be opened up to free and Plus users alike, including on iOS and Android. In addition, custom instructions can now be used even with chat history turned off, OpenAI notes.

To use custom instructions, you first click on your name and then select “Custom instructions” to get started.

The feature will expand across the EU and U.K. soon, the company says.

Turning Rural India into Data Mining Hubs

TIME recently covered a brilliant piece on how the rural market is contributing to the development of AI systems such as ChatGPT and alike, where it not only highlighted the rising demand for training datasets in one’s own native language, but emphasised the need for more inclusive solutions. The company behind this led us to Bangalore-launched Karya, a nonprofit organisation that is working towards accelerating social mobility in the country via AI training and upskilling.

Founded by Manu Chopra and Vivek Seshadri in 2021, Karya was created with the vision of making an ecosystem of ethical data usage at the same time financially and technologically empower communities.

Manu and Vivek were Microsoft researchers. From 2017 to 2020 Karya was a Microsoft incubated centre, post which it has been functioning as a separate private entity. Exploring for a project by Microsoft that involved data collection in particular languages involved seeking a partnership with people from rural areas, however, the approach could not be a direct one – building trust was the main challenge.

That is where Jeevitha Satheeshkumar joined them, currently the Director of Operations at Karya. With over 10 years of experience as a software trainer, she began experimenting with projects with a social implication very early on. She has been part of campaigns such as ‘Plastic Free India’ to spread awareness amongst mothers to use stainless steel feeding bottles as opposed to plastic feeding bottles. Her foray into language training happened when she started freelancing as a Tamil linguist. With the company requiring over 100 people for language transcription, she then looked into tapping the rural market.

“It is difficult for people who live in rural areas to get opportunities outside their area, and with online job frauds and scams, trust becomes a problem- I wanted to change that so I started training people on data annotating or labelling.”

Jeevitha Satheeshkumar

From here, for over six years, Satheeshkumar became a second party vendor for Microsoft, Google and other companies, and expanded the training to over 5000 people who work with multiple languages. She eventually built her own company, and gave opportunities to rural people, homemakers and even those with physical disabilities. Understanding the cyclical nature of demand for this service, she decided to build it as a product offering. “In India, only two or three companies have their own transcription tool/ AI tool to do this kind of work.”

The tool named ‘Labely’ was built to perform functions such as transcription and various types of annotations. Multiple modules such as manager, proofreader, transcriber were built onto the platform. “Any company that wishes to create a data set can use this tool.”

“Having a shared vision of creating the same kind of social impact, creating opportunities for rural people and helping communities looking for a job or some kind of learning, we joined hands,” said Satheeshkumar. “Last year, we successfully completed our first pilot project with IIT Madras”

Challenges Galore

“It is not possible to go directly to them and offer them a job, as there is no trust element built between the parties. So, we connected with local NGOs, as they are aware of the right set of people who would benefit from this. They started in a remote area in Rajasthan and gave data collection work in Rajasthani dialect,” said Sathheshkumar. Karya has completed over 30M+ digital tasks.

“Our goal is to reach 100,000 rural Indians by the end of this fiscal year, 1.5 million rural Indians by next fiscal year and 100 million rural Indians by 2030. Fundamentally, Karya’s goal is to use technology to accelerate social mobility in rural India. It currently takes an average low-income Indian over 7 generations to make $1500 in savings and a Karya worker can make the same amount in less than a year. We think of Karya not as a job, but as societal wealth distribution,” said Chopra, in an exclusive interview with AIM.

Manu Chopra

Designed for Rural India

The Karya application has been built such that anyone can use it with ease. The app is simple with an easy user interface, where a person can read and record the text shown in the app, with an option to re-record as well. A basic Android phone is required for using the app. However, Karya is working towards catering to low end phone models too, owing to rural areas where the target group might not have access to an android phone but a lower version too.

Earlier, voice recordings were done on phones and shared via Google Drive, but with the Karya app, it can be directly recorded. Once the recording is submitted, it moves to a ‘proofreader validator.’ First there is an automation process to check the quality of audio- to check for missing speech or non technical inputs in audio. Post validation, it then moves to ‘transcriber’. The process involves segmentation(classification) and transcription, where labeling and transcribing exact word-by-word for the recorded speech happens. It then reaches the final process of validation and the file is converted into either a txt or JSON format depending on their customer’s requirement.

Rural Supersedes Urban

People in rural areas show better prowess when it comes to learning and implementing new skills. “For language recordings, people who live in rural areas would be able to do it better than their urban counterparts. Owing to having studied and schooled in their native language, they know the language better than others.” Satheeshkumar has also learned that people who live in villages have better grasping power than the ones from cities. “The people there are focussed and always ready to do anything that will help them. As opposed to people in urban areas who can get distracted, the people here are fully focussed during training and listen attentively without batting an eyelid. Though such opportunities are high-hanging fruits for them, we want to bring it to their doorsteps.” said Satheeshkumar.

Socially Fueling the Indian AI Ecosystem

In addition to working with big tech companies and foundations such as Microsoft, Bill and Melinda Gates Foundation, Karya has also partnered with universities such as MIT, Stanford, IIT Madras and IIT Bombay. Currently, they are working with AI4Bharat, which builds open-source AI for Indian languages. Touted as a promising player for revolutionising the LLM space in India, AI4Bharat has over 200 translators over 22 Indian languages. Karya generates and provides datasets for this Indic platform.

With a simple linear model of functioning, the workers who provide their service are rewarded justly- from a minimum of $5 per hour, it can go as high as $30/hr, depending on skill sets. “Other companies who outsource such projects involve multiple vendors with multiple stages of transfer, ultimately leading to the last man receiving $1 or $2. However, in Karya, the structure is simple with no middle vendors. It goes : customer, Karya then workers. If a person is able to provide transcription worth $30 daily, in a month they can receive up to INR 50000. The payment process is automated as well. After validation of the tasks completed by the workers, within 10 to 15 days payment is done through UPI or bank account.

Identifying the Workers

As there will never be a shortage of people for these tasks, Karya ensures that it reaches the right set of people. Initially, when the app was launched, the first 100 downloads were done by men from urban areas who can do high level jobs, which defeats the purpose. After which, any form of task requirements are approached via NGOs in relevant areas who help connect with their right audience.

There are over 180 NGO partners for Karya. “Currently we are working on two projects that require a minimum of 800 to 1000 people in each district. India has 766 districts and employing a 1000 for each would require our NGO partners for the right identification.”

Speaking about future plans, Manu said, “To scale our operations, we want to capture a bigger section of the global AI training data market. To do this, we have to raise more awareness about our work and work with many more big tech companies.” said Manu

The post Turning Rural India into Data Mining Hubs appeared first on Analytics India Magazine.

Overcoming Barriers in Multi-lingual Voice Technology: Top 5 Challenges and Innovative Solutions

Introduction

How often have you had to pause after asking your voice assistant about something in Spanish, your preferred language, and then restate your ask in the language that the voice assistant understands, likely English, because the voice assistant did not understand your request in Spanish? Or how often have you had to deliberately mis-pronounce your favorite artist A. R. Rahman’s name when asking your voice assistant to play their music because you know that if you say their name the right way, the voice assistant will simply not understand, but if you say A. R. Ramen the voice assistant will get it? Further, how often have you cringed when the voice assistant, in their soothing, all-knowing voice, butcher the name of your favorite musical Les Misérables and distinctly pronounce it as "Les Miz-er-ables"?

Despite voice assistants having become mainstream about a decade ago, they continue to remain simplistic, specifically in their understanding of user requests in multilingual contexts. In a world where multi-lingual households are on the rise and the existing and potential user base is becoming increasingly global and diverse, it is critical for voice assistants to become seamless when it comes to understanding user requests, irrespective of their language, dialect, accent, tone, modulation, and other speech characteristics. However, voice assistants continue to lag woefully when it comes to being able to smoothly converse with users in a way that humans do with each other. In this article, we will dive into what the top challenges in making voice assistants operate multi-lingually are, and what some strategies to mitigate these challenges might be. We will use a hypothetical voice assistant, Nova, throughout this article, for illustration purposes.

How Voice Assistants Work

Before diving into the challenges and opportunities with respect to making voice assistant user experiences multilingual, let’s get an overview of how voice assistants work. Using Nova as the hypothetical voice assistant, we look at how the end-to-end flow for asking for a music track looks like (reference).

Overcoming Barriers in Multi-lingual Voice Technology: Top 5 Challenges and Innovative Solutions
Fig. 1. End-to-end overview of hypothetical voice assistant Nova

As seen in Fig. 1., when a user asks Nova to play acoustic music by the popular band Coldplay, this sound signal of the user is first converted to a string of text tokens, as a first step in the human – voice assistant interaction. This stage is called Automatic Speech Recognition (ASR) or Speech to Text (STT). Once the string of tokens is available, it is passed on to the Natural Language Understanding step where the voice assistant tries to understand the semantic and syntactic meaning of the user’s intent. In this case, the voice assistant’s NLU interprets that the user is looking for songs by the band Coldplay (i.e. interprets that Coldplay is a band) that are acoustic in nature (i.e. look for meta data of songs in the discography of this band and only select the songs with version = acoustic). This user intent understanding is then used to query the back-end to find the content that the user is looking for. Finally, the actual content that the user is looking for and any other additional information needed to present this output to the user is carried forward to the next step. In this step, the response and any other information available is used to decorate the experience for the user and satisfactorily respond to the user query. In this case, it would be a Text To Speech (TTS) output (“here’s some acoustic music by Coldplay”) followed by a playback of the actual songs that were selected for this user query.

Challenges in Building Multi-lingual Voice Assistants

Multi-lingual voice assistants (VAs) imply VAs that are able to understand and respond to multiple languages, whether they are spoken by the same person or persons or if they are spoken by the same person in the same sentence mixed with another language (e.g. “Nova, arrêt! Play something else”). Below are the top challenges in voice assistants when it comes to being able to operate seamlessly in a multi-modal setting.

  • Inadequate Quantity and Quantity of Language Resources

In order for a voice assistant to be able to parse and understand a query well, it needs to be trained on a significant amount of training data in that language. This data includes speech data from humans, annotations for ground truth, vast amounts of text corpora, resources for improved pronunciation of TTS (e.g. pronunciation dictionaries) and language models. While these resources are easily available for popular languages like English, Spanish and German, their availability is limited or even non-existent for languages like Swahili, Pashto or Czech. Even though these languages are spoken by enough people, there aren’t structured resources available for these. Creating these resources for multiple languages can be expensive, complex and manually intensive, creating headwinds to progress.

  • Variations in Language

Languages have different dialects, accents, variations and regional adaptations. Dealing with these variations is challenging for voice assistants. Unless a voice assistant adapts to these linguistic nuances, it would be hard to understand user requests correctly or be able to respond in the same linguistic tone in order to deliver natural sounding and more human-like experience. For example, the UK alone has more than 40 English accents. Another example is how the Spanish spoken in Mexico is different from the one spoken in Spain.

  • Language Identification and Adaptation

It is common for multi-lingual users to switch between languages during their interactions with other humans, and they might expect the same natural interactions with voice assistants. For example, “Hinglish” is a commonly used term to describe the language of a person who uses words from both Hindi and English while talking. Being able to identify the language(s) the user is interacting with the voice assistant in and adapting responses accordingly is a difficult challenge that no mainstream voice assistant can do today.

  • Language Translation

One way to scale the voice assistant to multiple languages could be translating the ASR output from a not-so-mainstream language like Luxembourgish into a language that can be interpreted by the NLU layer more accurately, like English. Commonly used translation technologies include using one or more techniques like Neural Machine Translation (NMT), Statistical Machine Translation (SMT), Rule-based Machine Translation (RBMT), and others. However, these algorithms might not scale well for diverse language sets and might also require extensive training data. Further, language-specific nuances are often lost, and the translated versions often seem awkward and unnatural. The quality of translations continues to be a persistent challenge in terms of being able to scale multi-lingual voice assistants. Another challenge in the translation step is the latency it introduces, degrading the experience of the human – voice assistant interaction.

  • True Language Understanding

Languages often have unique grammatical structures. For example, while English has the concept of singular and plural, Sanskrit has 3 (singular, dual, plural). There might also be different idioms that don’t translate well to other languages. Finally, there might also be cultural nuances and cultural references that might be poorly translated, unless the translating technique has a high quality of semantic understanding. Developing language specific NLU models is expensive.

Overcoming Challenges in Building Multi-lingual Voice Assistants

The challenges mentioned above are hard problems to solve. However, there are ways in which these challenges can be mitigated partially, if not fully, right away. Below are some techniques that can solve one or more of the challenges mentioned above.

  • Leverage Deep Learning to Detect Language

The first step in interpreting the meaning of a sentence is to know what language the sentence belongs to. This is where deep learning comes into the picture. Deep learning uses artificial neural networks and high volumes of data to create output that seems human-like. Transformer-based architecture (e.g. BERT) have demonstrated success in language detection, even in the cases of low resource languages. An alternative to transformer-based language detection model is a recurrent neural network (RNN). An example of the application of these models is that if a user who usually speaks in English suddenly talks to the voice assistant in Spanish one day, the voice assistant can detect and ID Spanish correctly.

  • Use Contextual Machine Translation to ‘Understand’ the Request

Once the language has been detected, the next step towards interpreting the sentence is to take the output of the ASR stage, i.e., the string of tokens, and translate this string, not just literally but also semantically, into a language that can be processed in order to generate a response. Instead of using translation APIs that might not always be aware of the context and peculiarities of the voice interface and also introduce suboptimal delays in responses because of high latency, degrading the user experience. However, if context-aware machine translation models are integrated into voice assistants, the translations can be of higher quality and accuracy because of being specific to a domain or the context of the session. For example, if a voice assistant is being used mainly for entertainment, it can leverage contextual machine translation to correctly understand and respond to questions about genres and sub-genres of music, musical instruments and notes, cultural relevance of certain tracks, and more.

  • Capitalize on Multi-lingual Pre-trained Models

Since every language has a unique structure and grammar, cultural references, phrases, idioms and expressions and other nuances, it is challenging to process diverse languages. Given language specific models are expensive, pre-trained multi-lingual models can help capture language specific nuances. Models like BERT and XLM-R are good examples of pre-trained models that can capture language specific nuances. Lastly, these models can be fine-tuned to a domain to further increase their accuracy. For example, for a model trained on the music domain might be able to not just understand the query but also return a rich response via a voice assistant. If this voice assistant is asked what the meaning behind the lyrics of a song are, the voice assistant will be able to answer the question in a much richer way than a simple interpretation of the words.

  • Use Code Switching Models

Implementing code switching models for being able to handle language input that is a mix of different languages can help in the cases where a user uses more than one language in their interactions with the voice assistant. For example, if a voice assistant is designed specifically for a region in Canada where users often mix up French and English, a code-switching model can be used to understand sentences directed to the voice assistant that are a mix of the two languages and the voice assistant will be able to handle it.

  • Leverage Transfer Learning and Zero Shot Learning for Low Resource Languages

Transfer learning is a technique in ML where a model is trained on one task but is used as a starting point for a model on a second task. It uses the learning from the first task to improve the performance of the second task, thus overcoming the cold-start problem to an extent. Zero shot learning is when a pre-trained model is used to process data it has never seen before. Both Transfer Learning and Zero Shot learning can be leveraged to transfer knowledge from high-resource languages into low-resource languages. For example, if a voice assistant is already trained on the top 10 languages spoken most commonly in the world, it could be leveraged to understand queries in low resource languages like Swahili.

Conclusion

In summary, building and implementing multilingual experiences on voice assistants is challenging, but there are also ways to mitigate some of these challenges. By addressing the challenges called out above, voice assistants will be able to provide a seamless experience to their users, irrespective of their language.
Ashlesha Kadam leads a global product team at Amazon Music that builds music experiences on Alexa and Amazon Music apps (web, iOS, Android) for millions of customers across 45+ countries. She is also a passionate advocate for women in tech, serving as co-chair for the Human Computer Interaction (HCI) track for Grace Hopper Celebration (biggest tech conference for women in tech with 30K+ participants across 115 countries). In her free time, Ashlesha loves reading fiction, listening to biz-tech podcasts (current favorite — Acquired), hiking in the beautiful Pacific Northwest and spending time with her husband, son and 5yo Golden Retriever.

More On This Topic

  • Overcoming Imbalanced Data Challenges in Real-World Scenarios
  • 5 Data Management Challenges with Solutions
  • Overcoming the Simplicity Illusion with Data Migration
  • 8 Innovative BERT Knowledge Distillation Papers That Have Changed The…
  • Introduction to Multi-Armed Bandit Problems
  • Multi-modal deep learning in less than 15 lines of code

Maya is Not the First Indigenously Built Operating System in India

Microsoft Windows is probably the most-widely used operating system (OS) in the world, so much so that is the OS used by Indian defence forces as well. However, things are about to change. According to The Hindu, the Defence Ministry has ditched Windows for an indigenously built operating system — Maya.

While Maya OS will be used by the Defence Ministry for now, eventually the plan is to replace Windows across the Army, Airforce, and Navy, forming the future operational system. Here, some may argue that the development is a decade late, given China has been using Kylin, their own indigenously developed OS, for over a decade now. The move may be late, but is a welcome one indeed.

However, Maya OS is not the first Indian indigenously built operating system. In 2007, the Centre for Development of Advanced Computing (C-DAC) released the Bharat Operating System Solutions (BOSS) with the aim of promoting the adoption of free and open-source software throughout India. Available in 19 Indian languages, BOSS was also being used by the Indian Army. In 2017, Army’s Jammu & Kashmir-based Northern Command integrated the indigenous operating system to enhance cyber security and protect the Army’s communication and information networks from cyber attacks.

Taking into account the Army’s initial trials with BOSS as far back as over six years, the prevailing query is why the government chose to create a fresh operating system, especially when reports suggest that the Indian Army was already experimenting with BOSS.

Based on Ubuntu Linux distribution

OS Maya is based on the open-source Ubuntu Linux distribution and has been developed locally by government agencies within a time period of six months. Agencies involved include the Centre for Development of Advanced Computing (C-DAC), the Defence Research and Development Organisation (DRDO), and the National Informatics Centre (NIC). Despite being based on Ubuntu Linux, Maya boasts an interface and functionalities similar to Windows, ensuring a seamless transition for users.

It also provides compatibility with prevalent applications like Microsoft Office, Adobe Photoshop, and AutoCAD, which are extensively utilised by the ministry. Additionally, it incorporates advanced attributes like cloud storage, encryption, digital signature, and biometric authentication, bolstering both security and functionality.

“One valuable aspect is the increased control over the operating system’s functionality. This facilitates adaptability for custom applications, industrial automation, and seamless functioning of defence software. Furthermore, it guarantees regular security patches without disrupting mission-critical applications,” Kiran Vangaveti, founder & chief executive officer at BluSapphire Cyber Systems, told AIM.

Given Linux is open source, it makes sense for the Indian government to build Maya on top of it instead of building an operating system from scratch. “Due to being open source, Linux stands as the top preference for organisations seeking to develop their own operating systems to power some of their products, like routers, Internet-of-Things (IoT) and some cybersecurity devices. It provides a key foundation versus starting from scratch entirely,” Satnam Narang, senior staff research engineer at Tenable, told AIM.

Ensuring cyber resilient is an arduous task

Windows is the most widely used operating system in the world and in comparison, Linux powers around just 3% of global desktops. Shifting to a Linux-based operating system will provide some relief when it comes to cyberattacks. “While it’s safe to say that this shift will eliminate ‘some’ of the challenges, it doesn’t change the fact that cybercriminals, especially those determined to breach these networks, including advanced persistent threat (APT) groups, will stop their attempts,” Narang elaborated.

Moreover, Microsoft has invested substantial resources, including billions of dollars, into fortifying the cybersecurity of Windows. Developing a similar level of cyber resilience for OS Maya could demand comparable investments and resources. However, the question arises whether Indian government agencies possess the financial capacity and resources to allocate towards such an endeavour. The scale of Microsoft’s commitment to Windows security highlights the substantial efforts needed for a robust operating system security framework, urging careful consideration for India’s own OS, Maya.

In India, abundant technical prowess exists, but the challenge lies in consistent direction and commitment. “Ensuring the operating system stays updated with security patches, adapting to changing infrastructure and use cases, creating driver ecosystems for compatibility and fostering user adoption through continuous engagement with the community is a distinct challenge. This demands substantial vision, determination, and funding. In a nation where election priorities shift unpredictably like the weather, its outcome is uncertain,” Vangaveti said.

Given that OS Maya is built on top of the open-source Linux distribution known as Ubuntu, it already has access to regular software updates that include security fixes. But things can get complicated when new applications are built on top of OS Maya, introducing the potential for various bugs.

“There are also reports that Maya OS will include an endpoint security software known as Chakravyuh, though details about it remain undisclosed. Having some type of security software is key. But I think for the Defence Ministry and others that utilise Maya OS, it will also be important to ensure they have the proper incident response processes in place, whether that’s in-house or through collaboration with the Indian Computer Emergency Response Team (CERT-IN) to ensure a speedy response to potential cyber incidents,” Narang said.

Relevance amidst a cyberwar

The primary reason the Defence Ministry is dumping Windows is to prevent malware and cyber attacks. Various ministries and agencies have been victims of numerous cyberattacks in recent years. A report from 2019 mentioned that the Indian Army faced at least two cyberattacks every month. Most of these attacks originate from neighbouring countries Pakistan and China and are not limited to just defence organisations and ministries. Last year, Solar Industries Limited India, the parent company of a private defence ministry contractor producing explosives, fell victim to a ransomware attack. Similarly, last year, Central Depository Services Limited (CSDL) detected malware in some of its internal machines.

Interestingly, India is not a just victim, but various cyberattacks in Pakistan and China also originate from the Indian soil. Hence, an indigenously made OS makes sense. Moreover, with the advent of AI, the very landscape and dynamic of cybersecurity is evolving. Maya OS will lead to enhanced security, cyber resilience and reduced dependency. Moreover, it will provide greater control over data, sensitive information, and communication channels.

“There are trade-offs in every decision, even switching to a Linux-based operating system has its benefits. However, maintaining a consistent schedule of software updates holds equal significance as it is possible for these systems to fall behind on patches for the underlying operating system and software applications installed on those systems,” Narang said.

Scepticism remains

Earlier this year, government officials including Union Minister Ashwini Vaishnaw heavily promoted on social media an indigenous operating system which will take on the likes of Android and iOS. Called BharOS, the system was developed by JandK Operations Private Limited, an Indian Institute of Technology (IIT) Madras-incubated firm.

But since BharOS was developed by merely a fork of the Android Open Source Project (AOSP) devoid of Google apps, another question being put forth was whether it was appropriate to promote it as a truly indigenous technology. Similarly, given that not much is known about Maya OS, parallels can be drawn since the operating system is again based on the open-source Ubuntu Linux distribution.

The post Maya is Not the First Indigenously Built Operating System in India appeared first on Analytics India Magazine.

ChatGPT’s Custom Instructions feature is now available for everyone

ChatGPT on a phone on top of a keyboard

Getting your ideal answer from ChatGPT is a difficult skill to perfect. Usually, you have to carefully craft your initial response and follow up with a couple more prompts to get the end result you envisioned.

In late July, ChatGPT announced "Custom Instructions" to solve that issue. With Custom Instructions, users can set preferences that tailor how ChatGPT generates responses.

Also: 6 helpful ways to use ChatGPT's Custom Instructions

The instructions are kept under consideration by ChatGPT when producing responses for every conversation after, so you don't have to put the same preferences in over and over to get the response you want.

Upon release, the feature was only available for ChatGPT Plus users. However, on Wednesday, OpenAI announced that all users could access the feature on the free plan.

The feature gives users two additional fields that they can use to customize their prompts: "What would you like ChatGPT to know about you to provide better responses?" and "How would you like ChatGPT to respond?"

In the initial release, OpenAI shared demos of the feature with the examples of a third-grade teacher developing a lesson plan, a developer wanting code in a language other than Python, and a family of six dinner planning to show how Custom Instructions can help workflow.

In all three cases, the users would be able to set the conditions once in the beginning and then get the results they want for their specific tasks over and over without having to do any tweaking or unnecessary repeating.

Also: ChatGPT is getting a slew of updates this week. Here's what you need to know

For example, the developer would only have to delineate once that they are a software developer only using Golang, want all of their responses to be in the language, and want code with no explanations and bias towards the most efficient solution.

This feature eliminates some of the challenges of prompt writing and makes it easier to get intended results faster, increasing chatbot assistance.

Artificial Intelligence

How Deutsche Bank is Riding the Generative AI Wave

“The power of LLMs coupled with automation tools, open APIs and adaptable business processes will transform the way companies and industries operate, both in speed, quality and costs,” Srikanth Gopalakrishnan, Managing Director, CIO (HR), Deutsche Bank Group told AIM in an exclusive interview.

Deutsche Bank has followed a strategic approach in embracing generative AI and advanced technologies as catalysts for transformation within the financial sector, which has initially been shying away from jumping into the bandwagon. The banking giant is not only riding the generative AI wave but also pioneering a comprehensive evolution of their business practices for the future.

Deutsche Bank’s Generative AI Voyage

The bank’s innovation team within their global Technology, Data and Innovation (TDI) division is exploring and testing AI and generative AI uses cases in collaboration with our business and infrastructure divisions.

Recognising the immense potential that AI has, DB has a range of opportunities throughout its operations including gaining precise insights into client behavior and preferences, enhancing operational efficiency, and leveraging AI for investment decisions. Currently, the bank is globally investigating three key areas: developing software code that aids developers in boosting productivity, implementing AI chatbots to assist employees and clients with queries using unstructured data and voice, and accelerating risk calculations.

Gopalakrishnan anticipates that in the future, AI and ML will integrate seamlessly into nearly every facet of their business, spanning internal operations encompassing HR, finance, legal, and IT, as well as customer-facing interactions and capabilities.

DB has been employing AI solutions alongside classical AI models, such as Regression or Random Forest, for a long time now. These applications include the automation of manual procedural stages, such as data matching and validation, along with the handling of substantial volumes of unstructured data. Notably, these mechanisms expedite the previously labor-intensive procedures of assessing and managing loan documents within the lending sector. Furthermore, AI models are harnessed for monitoring financial transactions to detect potential instances of financial misconduct, while also being progressively integrated into customer advisory services.

Partnership is the Key

“Partnerships are essential in times of transformation. And, we believe in the opportunities that arise from partnerships – with emerging fintechs and start-ups, and also with the large technology companies,” said Gopalakrishnan.

The company is engaged with the current development around AI chatbots, generative AI tools and LLMs. It is one of the handful of ‘trusted testers’ that has been given early access to test Google’s capabilities here,”

To make this possible, DB has collaborated with various tech giants that offer generative AI services. Their multi-year partnership with NVIDIA is a move to propel their adoption of AI solutions.

Their cloud transformation and partnership with Google Cloud since December 2020 have helped them establish advanced data analytics and AI and ML capabilities across the bank. For instance, the collaboration allows them to experiment with and adopt the latest technologies from Google Cloud, promoting innovation throughout the bank. The recent introduction of Google Cloud’s generative AI offerings is seen as a valuable opportunity to use cutting-edge technology securely and responsibly. Google has a suite of such offerings including generative AI powered Vertex AI, app builder, Duet AI for Google Workspace and Google Cloud and more. They are looking forward to directly accessing AI solutions in the cloud to easily incorporate them into new applications, providing a significant advantage for their future plans.

“Cloud is a key part of our technology strategy for several reasons, and this includes the agility that it provides to our business,” he added. It enables them flexible scalability, eliminates infrastructure bottlenecks, and accelerates innovation and market entry. Embracing the cloud necessitates rethinking controls and policy-as-code, empowering development teams and enhancing business agility, thereby expediting digital transformation. The strong strategic collaboration between NVIDIA and Google Cloud has proven advantageous and is actively contributing to their progress.

Cracking the Code of Responsible AI

At the core of DB’s AI and analytics play lies responsible AI ensuring not only adherence to data privacy regulations, but also the delivery of transparent, consistent, and dependable outcomes. Within the financial industry, a cautious and secure approach to harnessing AI’s potential is imperative. They emphasise the need for responsible utilisation, ensuring fairness, the absence of hidden biases, and factual accuracy in banking algorithms.

“As such we do not deploy any ‘black box’ algorithms in Machine learning,” he added. The incorporation of a ‘human in the loop’ approach is a key element in their toolkit for minimising errors like ‘hallucination’ and ‘omissions’. It is emphasized that no exemptions are granted to emerging technologies; AI must align with core requisites encompassing data protection, anti-financial crime measures, and cyber security.

Read more: Responsible AI Takes Center Stage at Google I/O Connect

The post How Deutsche Bank is Riding the Generative AI Wave appeared first on Analytics India Magazine.

A Comprehensive Guide to MLOps

A Comprehensive Guide to MLOps

Introduction

ML models have grown significantly in recent years, and businesses increasingly rely on them to automate and optimize their operations. However, managing ML models can be challenging, especially as models become more complex and require more resources to train and deploy. This has led to the emergence of MLOps as a way to standardize and streamline the ML workflow. MLOps emphasizes the need for continuous integration and continuous deployment (CI/CD) in the ML workflow, ensuring that models are updated in real-time to reflect changes in data or ML algorithms. This infrastructure is valuable in areas where accuracy, reproducibility, and reliability are critical, such as healthcare, finance, and self-driving cars. By implementing MLOps, organizations can ensure that their ML models are continuously updated and accurate, helping to drive innovation, reduce costs, and improve efficiency.

What is MLOps?

MLOps is a methodology combining ML and DevOps practices to streamline developing, deploying, and maintaining ML models. MLOps share several key characteristics with DevOps, including:

  • CI/CD: MLOps emphasizes the need for a continuous cycle of code, data, and model updates in ML workflows. This approach requires automating as much as possible to ensure consistent and reliable results.
  • Automation: Like DevOps, MLOps stresses the importance of automation throughout the ML lifecycle. Automating critical steps in the ML workflow, such as data processing, model training, and deployment, results in a more efficient and reliable workflow.
  • Collaboration and Transparency: MLOps encourages a collaborative and transparent culture of shared knowledge and expertise across teams developing and deploying ML models. This helps to ensure a streamlined process, as handoff expectations will be more standardized.
  • Infrastructure as Code (IaC): DevOps and MLOps employ an “infrastructure as code” approach, in which infrastructure is treated as code and managed through version control systems. This approach allows teams to manage infrastructure changes more efficiently and reproducibly.
  • Testing and Monitoring: MLOps and DevOps emphasize the importance of testing and monitoring to ensure consistent and reliable results. In MLOps, this involves testing and monitoring the accuracy and performance of ML models over time.
  • Flexibility and Agility: DevOps and MLOps emphasize flexibility and agility in response to changing business needs and requirements. This means being able to rapidly deploy and iterate on ML models to keep up with evolving business demands.

The bottom line is that ML has a lot of variability in its behavior, given that models are essentially a black box used to generate some prediction. While DevOps and MLOps share many similarities, MLOps requires a more specialized set of tools and practices to address the unique challenges posed by data-driven and computationally-intensive ML workflows. ML workflows often require a broad range of technical skills that go beyond traditional software development, and they may involve specialized infrastructure components, such as accelerators, GPUs, and clusters, to manage the computational demands of training and deploying ML models. Nevertheless, taking the best practices of DevOps and applying them across the ML workflow will significantly reduce project times and provide the structure ML needs to be effective in production.

Importance and Benefits of MLOps in Modern Business

ML has revolutionized how businesses analyze data, make decisions, and optimize operations. It enables organizations to create powerful, data-driven models that reveal patterns, trends, and insights, leading to more informed decision-making and more effective automation. However, effectively deploying and managing ML models can be challenging, which is where MLOps comes into play. MLOps is becoming increasingly important for modern businesses because it offers a range of benefits, including:

  • Faster Development Time: MLOps allows organizations to accelerate the development life-cycle of ML models, reducing the time to market and enabling businesses to respond quickly to changing market demands. Furthermore, MLOps can help automate many tasks in data collection, model training, and deployment, freeing up resources and speeding up the overall process.
  • Better Model Performance: With MLOps, businesses can continuously monitor and improve the performance of their ML models. MLOps facilitates automated testing mechanisms for ML models, which detects problems related to model accuracy, model drift, and data quality. Organizations can improve their ML models' overall performance and accuracy by addressing these issues early, translating into better business outcomes.
  • More Reliable Deployments: MLOps allows businesses to deploy ML models more reliably and consistently across different production environments. By automating the deployment process, MLOps reduces the risk of deployment errors and inconsistencies between different environments when running in production.
  • Reduced Costs and Improved Efficiency: Implementing MLOps can help organizations reduce costs and improve overall efficiency. By automating many tasks involved in data processing, model training, and deployment, organizations can reduce the need for manual intervention, resulting in a more efficient and cost-effective workflow.

In summary, MLOps is essential for modern businesses looking to leverage the transformative power of ML to drive innovation, stay ahead of the competition, and improve business outcomes. By enabling faster development time, better model performance, more reliable deployments, and enhanced efficiency, MLOps is instrumental in unlocking the full potential of harnessing ML for business intelligence and strategy. Utilizing MLOps tools will also allow team members to focus on more important matters and businesses to save on having large dedicated teams to maintain redundant workflows.

The MLOps Lifecycle

Whether creating your own MLOps infrastructure or selecting from various available MLOps platforms online, ensuring your infrastructure encompasses the four features mentioned below is critical to success. By selecting MLOps tools that address these vital aspects, you will create a continuous cycle from data scientists to deployment engineers to deploy models quickly without sacrificing quality.

Continuous Integration (CI)

Continuous Integration (CI) involves constantly testing and validating changes made to code and data to ensure they meet a set of defined standards. In MLOps, CI integrates new data and updates to ML models and supporting code. CI helps teams catch issues early in the development process, enabling them to collaborate more effectively and maintain high-quality ML models. Examples of CI practices in MLOps include:

  • Automated data validation checks to ensure data integrity and quality.
  • Model version control to track changes in model architecture and hyperparameters.
  • Automated unit testing of model code to catch issues before the code is merged into the production repository.

Continuous Deployment (CD)

Continuous Deployment (CD) is the automated release of software updates to production environments, such as ML models or applications. In MLOps, CD focuses on ensuring that the deployment of ML models is seamless, reliable, and consistent. CD reduces the risk of errors during deployment and makes it easier to maintain and update ML models in response to changing business requirements. Examples of CD practices in MLOps include:

  • Automated ML pipeline with continuous deployment tools like Jenkins or CircleCI for integrating and testing model updates, then deploying them to production.
  • Containerization of ML models using technologies like Docker to achieve a consistent deployment environment, reducing potential deployment issues.
  • Implementing rolling deployments or blue-green deployments minimizes downtime and allows for an easy rollback of problematic updates.

Continuous Training (CT)

Continuous Training (CT) involves updating ML models as new data becomes available or as existing data changes over time. This essential aspect of MLOps ensures that ML models remain accurate and effective while considering the latest data and preventing model drift. Regularly training models with new data helps maintain optimal performance and achieve better business outcomes. Examples of CT practices in MLOps include:

  • Setting policies (i.e., accuracy thresholds) that trigger model retraining to maintain up-to-date accuracy.
  • Using active learning strategies to prioritize collecting valuable new data for training.
  • Employing ensemble methods to combine multiple models trained on different subsets of data, allowing for continuous model improvement and adaptation to changing data patterns.

Continuous Monitoring (CM)

Continuous Monitoring (CM) involves constantly analyzing the performance of ML models in production environments to identify potential issues, verify that models meet defined standards, and maintain overall model effectiveness. MLOps practitioners use CM to detect issues like model drift or performance degradation, which can compromise the accuracy and reliability of predictions. By regularly monitoring the performance of their models, organizations can proactively address any problems, ensuring that their ML models remain effective and generate the desired results. Examples of CM practices in MLOps include:

  • Tracking key performance indicators (KPIs) of models in production, such as precision, recall, or other domain-specific metrics.
  • Implementing model performance monitoring dashboards for real-time visualization of model health.
  • Applying anomaly detection techniques to identify and handle concept drift, ensuring that the model can adapt to changing data patterns and maintain its accuracy over time.

How Does MLOps Benefit the ML Lifecycle?

Managing and deploying ML models can be time-consuming and challenging, primarily due to the complexity of ML workflows, data variability, the need for iterative experimentation, and the continuous monitoring and updating of deployed models. When the ML lifecycle is not properly streamlined with MLOps, organizations face issues such as inconsistent results due to varying data quality, slower deployment as manual processes become bottlenecks, and difficulty maintaining and updating models rapidly enough to react to changing business conditions. MLOps brings efficiency, automation, and best practices that facilitate each stage of the ML lifecycle.

Consider a scenario where a data science team without dedicated MLOps practices is developing an ML model for sales forecasting. In this scenario, the team may encounter the following challenges:

  • Data preprocessing and cleansing tasks are time-consuming due to the lack of standardized practices or automated data validation tools.
  • Difficulty in reproducibility and traceability of experiments due to inadequate versioning of model architecture, hyperparameters, and data sets.
  • Manual and inefficient deployment processes lead to delays in releasing models to production and the increased risk of errors in production environments.
  • Manual deployments can also add many failures in automatically scaling deployments across multiple servers online, affecting redundancy and uptime.
  • Inability to rapidly adjust deployed models to changes in data patterns, potentially leading to performance degradation and model drift.

There are five stages in the ML lifecycle, which are directly improved with MLOps tooling mentioned below.

Data Collection and Preprocessing

The first stage of the ML lifecycle involves the collection and preprocessing of data. Organizations can ensure data quality, consistency, and manageability by implementing best practices at this stage. Data versioning, automated data validation checks, and collaboration within the team lead to better accuracy and effectiveness of ML models. Examples include:

  • Data versioning to track changes in the datasets used for modeling.
  • Automated data validation checks to maintain data quality and integrity.
  • Collaboration tools within the team to share and manage data sources effectively.

Model Development

MLOps helps teams follow standardized practices during the model development stage while selecting algorithms, features, and tuning hyperparameters. This reduces inefficiencies and duplicated efforts, which improves overall model performance. Implementing version control, automated experimentation tracking, and collaboration tools significantly streamline this stage of the ML Lifecycle. Examples include:

  • Implementing version control for model architecture and hyperparameters.
  • Establishing a central hub for automated experimentation tracking to reduce repeating experiments and encourage easy comparisons and discussions.
  • Visualization tools and metric tracking to foster collaboration and monitor the performance of models during development.

Model Training and Validation

In the training and validation stage, MLOps ensures organizations use reliable processes for training and evaluating their ML models. Organizations can effectively optimize their models' accuracy by leveraging automation and best practices in training. MLOps practices include cross-validation, training pipeline management, and continuous integration to automatically test and validate model updates. Examples include:

  • Cross-validation techniques for better model evaluation.
  • Managing training pipelines and workflows for a more efficient and streamlined process.
  • Continuous integration workflows to automatically test and validate model updates.

Model Deployment

The fourth stage is model deployment to production environments. MLOps practices in this stage help organizations deploy models more reliably and consistently, reducing the risk of errors and inconsistencies during deployment. Techniques such as containerization using Docker and automated deployment pipelines enable seamless integration of models into production environments, facilitating rollback and monitoring capabilities. Examples include:

  • Containerization using Docker for consistent deployment environments.
  • Automated deployment pipelines to handle model releases without manual intervention.
  • Rollback and monitoring capabilities for quick identification and remediation of deployment issues.

Model Monitoring and Maintenance

The fifth stage involves ongoing monitoring and maintenance of ML models in production. Utilizing MLOps principles for this stage allows organizations to evaluate and adjust models as needed consistently. Regular monitoring helps detect issues like model drift or performance degradation, which can compromise the accuracy and reliability of predictions. Key performance indicators, model performance dashboards, and alerting mechanisms ensure organizations can proactively address any problems and maintain the effectiveness of their ML models. Examples include:

  • Key performance indicators for tracking the performance of models in production.
  • Model performance dashboards for real-time visualization of the model’s health.
  • Alerting mechanisms to notify teams of sudden or gradual changes in model performance, enabling quick intervention and remediation.

MLOps Tools and Technologies

Adopting the right tools and technologies is crucial to implement MLOps practices and managing end-to-end ML workflows successfully. Many MLOps solutions offer many features, from data management and experimentation tracking to model deployment and monitoring. From an MLOps tool that advertises a whole ML lifecycle workflow, you should expect these features to be implemented in some manner:

  • End-to-end ML lifecycle management: All these tools are designed to support various stages of the ML lifecycle, from data preprocessing and model training to deployment and monitoring.
  • Experiment tracking and versioning: These tools provide some mechanism for tracking experiments, model versions, and pipeline runs, enabling reproducibility and comparing different approaches. Some tools might show reproducibility using other abstractions but nevertheless have some form of version control.
  • Model deployment: While the specifics differ among the tools, they all offer some model deployment functionality to help users transition their models to production environments or to provide a quick deployment endpoint to test with applications requesting model inference.
  • Integration with popular ML libraries and frameworks: These tools are compatible with popular ML libraries such as TensorFlow, PyTorch, and Scikit-learn, allowing users to leverage their existing ML tools and skills. However, the amount of support each framework has differs across tooling.
  • Scalability: Each platform provides ways to scale workflows, either horizontally, vertically, or both, enabling users to work with large data sets and train more complex models efficiently.
  • Extensibility and customization: These tools offer varying extensibility and customization, enabling users to tailor the platform to their specific needs and integrate it with other tools or services as required.
  • Collaboration and multi-user support: Each platform typically accommodates collaboration among team members, allowing them to share resources, code, data, and experimental results, fostering more effective teamwork and a shared understanding throughout the ML lifecycle.
  • Environment and dependency handling: Most of these tools include features addressing consistent and reproducible environment handling. This can involve dependency management using containers (i.e., Docker) or virtual environments (i.e., Conda) or providing preconfigured settings with popular data science libraries and tools pre-installed.
  • Monitoring and alerting: End-to-end MLOps tooling could also offer some form of performance monitoring, anomaly detection, or alerting functionality. This helps users maintain high-performing models, identify potential issues, and ensure their ML solutions remain reliable and efficient in production.

Although there is substantial overlap in the core functionalities provided by these tools, their unique implementations, execution methods, and focus areas set them apart. In other words, judging an MLOps tool at face value might be difficult when comparing their offering on paper. All of these tools provide a different workflow experience.

In the following sections, we’ll showcase some notable MLOps tools designed to provide a complete end-to-end MLOps experience and highlight the differences in how they approach and execute standard MLOps features.

MLFlow

A Comprehensive Guide to MLOps

MLflow has unique features and characteristics that differentiate it from other MLOps tools, making it appealing to users with specific requirements or preferences:

  • Modularity: One of MLflow’s most significant advantages is its modular architecture. It consists of independent components (Tracking, Projects, Models, and Registry) that can be used separately or in combination, enabling users to tailor the platform to their precise needs without being forced to adopt all components.
  • Language Agnostic: MLflow supports multiple programming languages, including Python, R, and Java, which makes it accessible to a wide range of users with diverse skill sets. This primarily benefits teams with members who prefer different programming languages for their ML workloads.
  • Integration with Popular Libraries: MLflow is designed to work with popular ML libraries such as TensorFlow, PyTorch, and Scikit-learn. This compatibility allows users to integrate MLflow seamlessly into their existing workflows, taking advantage of its management features without adopting an entirely new ecosystem or changing their current tools.
  • Active, Open-source Community: MLflow has a vibrant open-source community that contributes to its development and keeps the platform up-to-date with new trends and requirements in the MLOps space. This active community support ensures that MLflow remains a cutting-edge and relevant ML lifecycle management solution.

While MLflow is a versatile and modular tool for managing various aspects of the ML lifecycle, it has some limitations compared to other MLOps platforms. One notable area where MLflow falls short is its need for an integrated, built-in pipeline orchestration and execution feature, such as those provided by TFX or Kubeflow Pipelines. While MLflow can structure and manage your pipeline steps using its tracking, projects, and model components, users may need to rely on external tools or custom scripting to coordinate complex end-to-end workflows and automate the execution of pipeline tasks. As a result, organizations seeking more streamlined, out-of-the-box support for complex pipeline orchestration may find that MLflow’s capabilities need improvement and explore alternative platforms or integrations to address their pipeline management needs.

Kubeflow

A Comprehensive Guide to MLOps

While Kubeflow is a comprehensive MLOps platform with a suite of components tailored to cater to various aspects of the ML lifecycle, it has some limitations compared to other MLOps tools. Some of the areas where Kubeflow may fall short include:

  • Steeper Learning Curve: Kubeflow’s strong coupling with Kubernetes may result in a steeper learning curve for users who need to become more familiar with Kubernetes concepts and tooling. This might increase the time required to onboard new users and could be a barrier to adoption for teams without Kubernetes experience.
  • Limited Language Support: Kubeflow was initially developed with a primary focus on TensorFlow, and although it has expanded support for other ML frameworks like PyTorch and MXNet, it still has a more substantial bias towards the TensorFlow ecosystem. Organizations working with other languages or frameworks may require additional effort to adopt and integrate Kubeflow into their workflows.
  • Infrastructure Complexity: Kubeflow’s reliance on Kubernetes might introduce additional infrastructure management complexity for organizations without an existing Kubernetes setup. Smaller teams or projects that don’t require the full capabilities of Kubernetes might find Kubeflow’s infrastructure requirements to be an unnecessary overhead.
  • Less Focus on Experiment Tracking: While Kubeflow does offer experiment tracking functionalities through its Kubeflow Pipelines component, it may not be as extensive or user-friendly as dedicated experiment tracking tools like MLflow or Weights & Biases, another end-to-end MLOps tool with emphasis on real-time model observability tools. Teams with a strong focus on experiment tracking and comparison might find this aspect of Kubeflow needs improvement compared to other MLOps platforms with more advanced tracking features.
  • Integration with Non-Kubernetes Systems: Kubeflow’s Kubernetes-native design may limit its integration capabilities with other non-Kubernetes-based systems or proprietary infrastructure. In contrast, more flexible or agnostic MLOps tools like MLflow might offer more accessible integration options with various data sources and tools, regardless of the underlying infrastructure.

Kubeflow is an MLOps platform designed as a wrapper around Kubernetes, streamlining deployment, scaling, and managing ML workloads while converting them into Kubernetes-native workloads. This close relationship with Kubernetes offers advantages, such as the efficient orchestration of complex ML workflows. Still, it might introduce complexities for users lacking Kubernetes expertise, those using a wide range of languages or frameworks, or organizations with non-Kubernetes-based infrastructure. Overall, Kubeflow’s Kubernetes-centric nature provides significant benefits for deployment and orchestration, and organizations should consider these trade-offs and compatibility factors when assessing Kubeflow for their MLOps needs.

Saturn Cloud

A Comprehensive Guide to MLOps

Saturn Cloud is an MLOps platform that offers hassle-free scaling, infrastructure, collaboration, and rapid deployment of ML models, focusing on parallelization and GPU acceleration. Some key advantages and robust features of Saturn Cloud include:

  • Resource Acceleration Focus: Saturn Cloud strongly emphasizes providing easy-to-use GPU acceleration & flexible resource management for ML workloads. While other tools may support GPU-based processing, Saturn Cloud simplifies this process to remove infrastructure management overhead for the data scientist to use this acceleration.
  • Dask and Distributed Computing: Saturn Cloud has tight integration with Dask, a popular library for parallel and distributed computing in Python. This integration allows users to scale out their workloads effortlessly to use parallel processing on multi-node clusters.
  • Managed Infrastructure and Pre-built Environments: Saturn Cloud goes a step further in providing managed infrastructure and pre-built environments, easing the burden of infrastructure setup and maintenance for users.
  • Easy Resource Management and Sharing: Saturn Cloud simplifies sharing resources like Docker images, secrets, and shared folders by allowing users to define ownership and access asset permissions. These assets can be owned by an individual user, a group (a collection of users), or the entire organization. The ownership determines who can access and use the shared resources. Furthermore, users can clone full environments easily for others to run the same code anywhere.
  • Infrastructure as Code: Saturn Cloud employs a recipe JSON format, enabling users to define and manage resources with a code-centric approach. This fosters consistency, modularity, and version control, streamlining the platform’s setup and management of infrastructure components.

Saturn Cloud, while providing useful features and functionality for many use cases, may have some limitations compared to other MLOps tools. Here are a few areas that Saturn Cloud might be limited in:

  • Integration with Non-Python Languages: Saturn Cloud primarily targets the Python ecosystem, with extensive support for popular Python libraries and tools. However, any language that can be run in a Linux environment can be run with the Saturn Cloud platform.
  • Out-of-the-Box Experiment Tracking: While Saturn Cloud does facilitate experiment logging and tracking, its focus on scaling and infrastructure is more extensive than its experiment tracking capabilities. However, those who seek more customization and functionality in the tracking side of the MLOps workflow will be pleased to know that Saturn Cloud can be integrated with platforms including, but not limited to, Comet, Weights & Biases, Verta, and Neptune.
  • Kubernetes-Native Orchestration: Although Saturn Cloud offers scalability and managed infrastructure via Dask, it lacks the Kubernetes-native orchestration that tools like Kubeflow provide. Organizations heavily invested in Kubernetes may prefer platforms with deeper Kubernetes integration.

TensorFlow Extended (TFX)

A Comprehensive Guide to MLOps

TensorFlow Extended (TFX) is an end-to-end platform designed explicitly for TensorFlow users, providing a comprehensive and tightly-integrated solution for managing TensorFlow-based ML workflows. TFX excels in areas like:

  • TensorFlow Integration: TFX’s most notable strength is its seamless integration with the TensorFlow ecosystem. It offers a complete set of components tailored for TensorFlow, making it easier for users already invested in TensorFlow to build, test, deploy, and monitor their ML models without switching to other tools or frameworks.
  • Production Readiness: TFX is built with production environments in mind, emphasizing robustness, scalability, and the ability to support mission-critical ML workloads. It handles everything from data validation and preprocessing to model deployment and monitoring, ensuring that models are production-ready and can deliver reliable performance at scale.
  • End-to-end Workflows: TFX provides extensive components for handling various stages of the ML lifecycle. With support for data ingestion, transformation, model training, validation, and serving, TFX enables users to build end-to-end pipelines that ensure the reproducibility and consistency of their workflows.
  • Extensibility: TFX’s components are customizable and allow users to create and integrate their own components if needed. This extensibility enables organizations to tailor TFX to their specific requirements, incorporate their preferred tools, or implement custom solutions for unique challenges they might encounter in their ML workflows.

However, it’s worth noting that TFX’s primary focus on TensorFlow can be a limitation for organizations that rely on other ML frameworks or prefer a more language-agnostic solution. While TFX delivers a powerful and comprehensive platform for TensorFlow-based workloads, users working with frameworks like PyTorch or Scikit-learn may need to consider other MLOps tools that better suit their requirements. TFX’s strong TensorFlow integration, production readiness, and extensible components make it an attractive MLOps platform for organizations heavily invested in the TensorFlow ecosystem. Organizations can assess the compatibility of their current tools and frameworks and decide whether TFX’s features align well with their specific use cases and needs in managing their ML workflows.

MetaFlow

A Comprehensive Guide to MLOps

Metaflow is an MLOps platform developed by Netflix, designed to streamline and simplify complex, real-world data science projects. Metaflow shines in several aspects due to its focus on handling real-world data science projects and simplifying complex ML workflows. Here are some areas where Metaflow excels:

  • Workflow Management: Metaflow’s primary strength lies in managing complex, real-world ML workflows effectively. Users can design, organize, and execute intricate processing and model training steps with built-in versioning, dependency management, and a Python-based domain-specific language.
  • Observable: Metaflow provides functionality to observe inputs and outputs after each pipeline step, making it easy to track the data at various stages of the pipeline.
  • Scalability: Metaflow easily scales workflows from local environments to the cloud and has tight integration with AWS services like AWS Batch, S3, and Step Functions. This makes it simple for users to run and deploy their workloads at scale without worrying about the underlying resources.
  • Built-in Data Management: Metaflow provides tools for efficient data management and versioning by automatically keeping track of datasets used by the workflows. It ensures data consistency across different pipeline runs and allows users to access historical data and artifacts, contributing to reproducibility and reliable experimentation.
  • Fault-Tolerance and Resilience: Metaflow is designed to handle the challenges that arise in real-world ML projects, such as unexpected failures, resource constraints, and changing requirements. It offers features like automatic error handling, retry mechanisms, and the ability to resume failed or halted steps, ensuring that workflows can be executed reliably and efficiently in various situations.
  • AWS Integration: As Netflix developed Metaflow, it closely integrates with Amazon Web Services (AWS) infrastructure. This makes it significantly easier for users already invested in the AWS ecosystem to leverage existing AWS resources and services in their ML workloads managed by Metaflow. This integration allows for seamless data storage, retrieval, processing, and control access to AWS resources, further streamlining the management of ML workflows.

While Metaflow has several strengths, there are certain areas where it may lack or fall short when compared to other MLOps tools:

  • Limited Deep Learning Support: Metaflow was initially developed to focus on typical data science workflows and traditional ML methods rather than deep learning. This might make it less suitable for teams or projects primarily working with deep learning frameworks like TensorFlow or PyTorch.
  • Experiment Tracking: Metaflow offers some experiment-tracking functionalities. Its focus on workflow management and infrastructural simplicity might make its tracking capabilities less comprehensive than dedicated experiment-tracking platforms like MLflow or Weights & Biases.
  • Kubernetes-Native Orchestration: Metaflow is a versatile platform that can be deployed on various backend solutions, such as AWS Batch and container orchestration systems. However, it lacks the Kubernetes-native pipeline orchestration found in tools like Kubeflow, which allows running entire ML pipelines as Kubernetes resources.
  • Language Support: Metaflow primarily supports Python, which is advantageous for most data science practitioners but might be a limitation for teams using other programming languages, such as R or Java, in their ML projects.

ZenML

A Comprehensive Guide to MLOps

ZenML is an extensible, open-source MLOps framework designed to make ML reproducible, maintainable, and scalable. ZenML is intended to be a highly extensible and adaptable MLOps framework. Its main value proposition is that it allows you to easily integrate and “glue” together various machine learning components, libraries, and frameworks to build end-to-end pipelines. ZenML’s modular design makes it easier for data scientists and engineers to mix and match different ML frameworks and tools for specific tasks within the pipeline, reducing the complexity of integrating various tools and frameworks.

Here are some areas where ZenML excels:

  • ML Pipeline Abstraction: ZenML offers a clean, Pythonic way to define ML pipelines using simple abstractions, making it easy to create and manage different stages of the ML lifecycle, such as data ingestion, preprocessing, training, and evaluation.
  • Reproducibility: ZenML strongly emphasizes reproducibility, ensuring pipeline components are versioned and tracked through a precise metadata system. This guarantees that ML experiments can be replicated consistently, preventing issues related to unstable environments, data, or dependencies.
  • Backend Orchestrator Integration: ZenML supports different backend orchestrators, such as Apache Airflow, Kubeflow, and others. This flexibility lets users choose the backend that best fits their needs and infrastructure, whether managing pipelines on their local machines, Kubernetes, or a cloud environment.
  • Extensibility: ZenML offers a highly extensible architecture that allows users to write custom logic for different pipeline steps and easily integrate with their preferred tools or libraries. This enables organizations to tailor ZenML to their specific requirements and workflows.
  • Dataset Versioning: ZenML focuses on efficient data management and versioning, ensuring pipelines have access to the correct versions of data and artifacts. This built-in data management system allows users to maintain data consistency across various pipeline runs and fosters transparency in the ML workflows.
  • High Integration with ML Frameworks: ZenML offers smooth integration with popular ML frameworks, including TensorFlow, PyTorch, and Scikit-learn. Its ability to work with these ML libraries allows practitioners to leverage their existing skills and tools while utilizing ZenML’s pipeline management.

In summary, ZenML excels in providing a clean pipeline abstraction, fostering reproducibility, supporting various backend orchestrators, offering extensibility, maintaining efficient dataset versioning, and integrating with popular ML libraries. Its focus on these aspects makes ZenML particularly suitable for organizations seeking to improve the maintainability, reproducibility, and scalability of their ML workflows without shifting too much of their infrastructure to new tooling.

What’s the Right Tool For Me?

With so many MLOps tools available, how do you know which one is for you and your team? When evaluating potential MLOps solutions, several factors come into play. Here are some key aspects to consider when choosing MLOps tools tailored to your organization’s specific needs and goals:

  • Organization Size and Team Structure: Consider the size of your data science and engineering teams, their level of expertise, and the extent to which they need to collaborate. Larger groups or more complex hierarchical structures might benefit from tools with robust collaboration and communication features.
  • Complexity and Diversity of ML Models: Evaluate the range of algorithms, model architectures, and technologies used in your organization. Some MLOps tools cater to specific frameworks or libraries, while others offer more extensive and versatile support.
  • Level of Automation and Scalability: Determine the extent to which you require automation for tasks like data preprocessing, model training, deployment, and monitoring. Also, understand the importance of scalability in your organization, as some MLOps tools provide better support for scaling up computations and handling large amounts of data.
  • Integration and Compatibility: Consider the compatibility of MLOps tools with your existing technology stack, infrastructure, and workflows. Seamless integration with your current systems will ensure a smoother adoption process and minimize disruptions to ongoing projects.
  • Customization and Extensibility: Assess the level of customization and extensibility needed for your ML workflows, as some tools provide more flexible APIs or plugin architectures that enable the creation of custom components to meet specific requirements.
  • Cost and Licensing: Keep in mind the pricing structures and licensing options of the MLOps tools, ensuring that they fit within your organization’s budget and resource constraints.
  • Security and Compliance: Evaluate how well the MLOps tools address security, data privacy, and compliance requirements. This is especially important for organizations operating in regulated industries or dealing with sensitive data.
  • Support and Community: Consider the quality of documentation, community support, and the availability of professional assistance when needed. Active communities and responsive support can be valuable when navigating challenges or seeking best practices.

By carefully examining these factors and aligning them with your organization’s needs and goals, you can make informed decisions when selecting MLOps tools that best support your ML workflows and enable a successful MLOps strategy.

MLOps Best Practices

Establishing best practices in MLOps is crucial for organizations looking to develop, deploy, and maintain high-quality ML models that drive value and positively impact their business outcomes. By implementing the following practices, organizations can ensure that their ML projects are efficient, collaborative, and maintainable while minimizing the risk of potential issues arising from inconsistent data, outdated models, or slow and error-prone development:

  • Ensuring data quality and consistency: Establish robust preprocessing pipelines, use tools for automated data validation checks like Great Expectations or TensorFlow Data Validation, and implement data governance policies that define data storage, access, and processing rules. A lack of data quality control can lead to inaccurate or biased model results, causing poor decision-making and potential business losses.
  • Version control for data and models: Use version control systems like Git or DVC to track changes made to data and models, improving collaboration and reducing confusion among team members. For example, DVC can manage different versions of datasets and model experiments, allowing easy switching, sharing, and reproduction. With version control, teams can manage multiple iterations and reproduce past results for analysis.
  • Collaborative and reproducible workflows: Encourage collaboration by implementing clear documentation, code review processes, standardized data management, and collaborative tools and platforms like Jupyter Notebooks and Saturn Cloud. Supporting team members to work together efficiently and effectively helps accelerate the development of high-quality models. On the other hand, ignoring collaborative and reproducible workflows results in slower development, increased risk of errors, and hindered knowledge sharing.
  • Automated testing and validation: Adopt a rigorous testing strategy by integrating automated testing and validation techniques (e.g., unit tests with Pytest, integration tests) into your ML pipeline, leveraging continuous integration tools like GitHub Actions or Jenkins to test model functionality regularly. Automated tests help identify and fix issues before deployment, ensuring a high-quality and reliable model performance in production. Skipping automated testing increases the risk of undetected problems, compromising model performance and ultimately hurting business outcomes.
  • Monitoring and alerting systems: Use tools like Amazon SageMaker Model Monitor, MLflow, or custom solutions to track key performance metrics and set up alerts to detect potential issues early. For example, configure alerts in MLflow when model drift is detected or specific performance thresholds are breached. Not implementing monitoring and alerting systems delays the detection of problems like model drift or performance degradation, resulting in suboptimal decisions based on outdated or inaccurate model predictions, negatively affecting the overall business performance.

By adhering to these MLOps best practices, organizations can efficiently develop, deploy, and maintain ML models while minimizing potential issues and maximizing model effectiveness and overall business impact.

MLOps and Data Security

Data security plays a vital role in the successful implementation of MLOps. Organizations must take necessary precautions to guarantee that their data and models remain secure and protected at every stage of the ML lifecycle. Critical considerations for ensuring data security in MLOps include:

  • Model Robustness: Ensure your ML models can withstand adversarial attacks or perform reliably in noisy or unexpected conditions. For instance, you can incorporate techniques like adversarial training, which involves injecting adversarial examples into the training process to increase model resilience against malicious attacks. Regularly evaluating model robustness helps prevent potential exploitation that could lead to incorrect predictions or system failures.
  • Data privacy and compliance: To safeguard sensitive data, organizations must adhere to relevant data privacy and compliance regulations, such as the General Data Protection Regulation (GDPR) or the Health Insurance Portability and Accountability Act (HIPAA). This may involve implementing robust data governance policies, anonymizing sensitive information, or utilizing techniques like data masking or pseudonymization.
  • Model security and integrity: Ensuring the security and integrity of ML models helps protect them from unauthorized access, tampering, or theft. Organizations can implement measures like encryption of model artifacts, secure storage, and model signing to validate authenticity, thereby minimizing the risk of compromise or manipulation by outside parties.
  • Secure deployment and access control: When deploying ML models to production environments, organizations must follow best practices for fast deployment. This includes identifying and fixing potential vulnerabilities, implementing secure communication channels (e.g., HTTPS or TLS), and enforcing strict access control mechanisms to restrict only model access to authorized users. Organizations can prevent unauthorized access and maintain model security using role-based access control and authentication protocols like OAuth or SAML.

Involving security teams like red teams in the MLOps cycle can also significantly enhance overall system security. Red teams, for instance, can simulate adversarial attacks on models and infrastructure, helping identify vulnerabilities and weaknesses that might otherwise go unnoticed. This proactive security approach enables organizations to address issues before they become threats, ensuring compliance with regulations and enhancing their ML solutions' overall reliability and trustworthiness. Collaborating with dedicated security teams during the MLOps cycle fosters a robust security culture that ultimately contributes to the success of ML projects.

MLOps Out in Industry

MLOps has been successfully implemented across various industries, driving significant improvements in efficiency, automation, and overall business performance. The following are real-world examples showcasing the potential and effectiveness of MLOps in different sectors:

Healthcare with CareSource

CareSource is one of the largest Medicaid providers in the United States focusing on triaging high-risk pregnancies and partnering with medical providers to proactively provide lifesaving obstetrics care. However, some data bottlenecks needed to be solved. CareSource’s data was siloed in different systems and was not always up to date, which made it difficult to access and analyze. When it came to model training, data was not always in a consistent format, which made it difficult to clean and prepare for analysis.

To address these challenges, CareSource implemented an MLOps framework that uses Databricks Feature Store, MLflow, and Hyperopt to develop, tune, and track ML models to predict obstetrics risk. They then used Stacks to help instantiate a production-ready template for deployment and send prediction results at a timely schedule to medical partners.

The accelerated transition between ML development and production-ready deployment enabled CareSource to directly impact patients' health and lives before it was too late. For example, CareSource identified high-risk pregnancies earlier, leading to better outcomes for mothers and babies. They also reduced the cost of care by preventing unnecessary hospitalizations.

Finance with Moody’s Analytics

Moody’s Analytics, a leader in financial modeling, encountered challenges such as limited access to tools and infrastructure, friction in model development and delivery, and knowledge silos across distributed teams. They developed and utilized ML models for various applications, including credit risk assessment and financial statement analysis. In response to these challenges, they implemented the Domino data science platform to streamline their end-to-end workflow and enable efficient collaboration among data scientists.

By leveraging Domino, Moody’s Analytics accelerated model development, reduced a nine-month project to four months, and significantly improved its model monitoring capabilities. This transformation allowed the company to efficiently develop and deliver customized, high-quality models for clients' needs, like risk evaluation and financial analysis.

Entertainment with Netflix

Netflix utilized Metaflow to streamline the development, deployment, and management of ML workloads for various applications, such as personalized content recommendations, optimizing streaming experiences, content demand forecasting, and sentiment analysis for social media engagement. By fostering efficient MLOps practices and tailoring a human-centric framework for their internal workflows, Netflix empowered its data scientists to experiment and iterate rapidly, leading to a more nimble and effective data science practice.

According to Ville Tuulos, a former manager of machine learning infrastructure at Netflix, implementing Metaflow reduced the average time from project idea to deployment from four months to just one week. This accelerated workflow highlights the transformative impact of MLOps and dedicated ML infrastructure, enabling ML teams to operate more quickly and efficiently. By integrating machine learning into various aspects of their business, Netflix showcases the value and potential of MLOps practices to revolutionize industries and improve overall business operations, providing a substantial advantage to fast-paced companies.

MLOps Lessons Learned

As we’ve seen in the aforementioned cases, the successful implementation of MLOps showcased how effective MLOps practices can drive substantial improvements in different aspects of the business. Thanks to the lessons learned from real-world experiences like this, we can derive key insights into the importance of MLOps for organizations:

  • Standardization, unified APIs, and abstractions to simplify the ML lifecycle.
  • Integration of multiple ML tools into a single coherent framework to streamline processes and reduce complexity.
  • Addressing critical issues like reproducibility, versioning, and experiment tracking to improve efficiency and collaboration.
  • Developing a human-centric framework that caters to the specific needs of data scientists, reducing friction and fostering rapid experimentation and iteration.
  • Monitoring models in production and maintaining proper feedback loops to ensure models remain relevant, accurate, and effective.

The lessons from Netflix and other real-world MLOps implementations can provide valuable insights to organizations looking to enhance their own ML capabilities. They emphasize the importance of having a well-thought-out strategy and investing in robust MLOps practices to develop, deploy, and maintain high-quality ML models that drive value while scaling and adapting to evolving business needs.

Future Trends and Challenges in MLOps

As MLOps continues to evolve and mature, organizations must stay aware of the emerging trends and challenges they may face when implementing MLOps practices. A few notable trends and potential obstacles include:

  • Edge Computing: The rise of edge computing presents opportunities for organizations to deploy ML models on edge devices, enabling faster and localized decision-making, reducing latency, and lowering bandwidth costs. Implementing MLOps in edge computing environments requires new strategies for model training, deployment, and monitoring to account for limited device resources, security, and connectivity constraints.
  • Explainable AI: As AI systems play a more significant role in everyday processes and decision-making, organizations must ensure that their ML models are explainable, transparent, and unbiased. This requires integrating tools for model interpretability, visualization, and techniques to mitigate bias. Incorporating explainable and responsible AI principles into MLOps practices helps increase stakeholder trust, comply with regulatory requirements, and uphold ethical standards.
  • Sophisticated Monitoring and Alerting: As the complexity and scale of ML models increase, organizations may require more advanced monitoring and alerting systems to maintain adequate performance. Anomaly detection, real-time feedback, and adaptive alert thresholds are some of the techniques that can help quickly identify and diagnose issues like model drift, performance degradation, or data quality problems. Integrating these advanced monitoring and alerting techniques into MLOps practices can ensure that organizations can proactively address issues as they arise and maintain consistently high levels of accuracy and reliability in their ML models.
  • Federated Learning: This approach enables training ML models on decentralized data sources while maintaining data privacy. Organizations can benefit from federated learning by implementing MLOps practices for distributed training and collaboration among multiple stakeholders without exposing sensitive data.
  • Human-in-the-loop Processes: There is a growing interest in incorporating human expertise in many ML applications, especially those that involve subjective decision-making or complex contexts that cannot be fully encoded. Integrating human-in-the-loop processes within MLOps workflows demands effective collaboration tools and strategies for seamlessly combining human and machine intelligence.
  • Quantum ML: Quantum computing is an emerging field that shows potential in solving complex problems and speeding up specific ML processes. As this technology matures, MLOps frameworks and tools may need to evolve to accommodate quantum-based ML models and handle new data management, training, and deployment challenges.
  • Robustness and Resilience: Ensuring the robustness and resilience of ML models in the face of adversarial circumstances, such as noisy inputs or malicious attacks, is a growing concern. Organizations will need to incorporate strategies and techniques for robust ML into their MLOps practices to guarantee the safety and stability of their models. This may involve adversarial training, input validation, or deploying monitoring systems to identify and alert when models encounter unexpected inputs or behaviors.

Conclusion

In today’s world, implementing MLOps has become crucial for organizations looking to unleash the full potential of ML, streamline workflows, and maintain high-performing models throughout their lifecycles. This article has explored MLOps practices and tools, use cases across various industries, the importance of data security, and the opportunities and challenges ahead as the field continues to evolve.

To recap, we have discussed the following:

  • The stages of the MLOps lifecycle.
  • Popular open-source MLOps tools that can be deployed to your infrastructure of choice.
  • Best practices for MLOps implementations.
  • MLOps use cases in different industries and valuable MLOps lessons learned.
  • Future trends and challenges, such as edge computing, explainable and responsible AI, and human-in-the-loop processes.

As the landscape of MLOps keeps evolving, organizations and practitioners must stay up-to-date with the latest practices, tools, and research. Emphasizing continued learning and adaptation will enable businesses to stay ahead of the curve, refine their MLOps strategies, and effectively address emerging trends and challenges.

The dynamic nature of ML and the rapid pace of technology means that organizations must be prepared to iterate and evolve with their MLOps solutions. This entails adopting new techniques and tools, fostering a collaborative learning culture within the team, sharing knowledge, and seeking insights from the broader MLOps community.

Organizations that embrace MLOps best practices, maintain a strong focus on data security and ethical AI, and remain agile in response to emerging trends will be better positioned to maximize the value of their ML investments. As businesses across industries leverage ML, MLOps will be increasingly vital in ensuring the successful, responsible, and sustainable deployment of AI-driven solutions. By adopting a robust and future-proof MLOps strategy, organizations can unlock the true potential of ML and drive transformative change in their respective fields.
Honson Tran is committed to the betterment of technology for humanity. He is extremely curious individual that loves all things technology. From front-end development to Artificial Intelligence and Autonomous Driving, I love it all. The main goal at the end of the day for him is to learn as much as he can in hopes of participating at a global level of discussion on where AI is taking us. He have 10+ years of IT experience, 5 years of programming experience, and a constant energetic force to suggest and impement new ideas. He is forever married to my work. Being the richest man in the cemetery doesn't matter to him. Going to bed at night saying he have contributed something new to technology every night, that's what matters to him.

Original. Reposted with permission.

More On This Topic

  • NLP, NLU, and NLG: What’s The Difference? A Comprehensive Guide
  • Comprehensive Guide to the Normal Distribution
  • A Comprehensive Guide to Ensemble Learning – Exactly What You Need to Know
  • Comprehensive Guide to the Normal Distribution
  • A Comprehensive Guide to Convolutional Neural Networks
  • How to MLOps like a Boss: A Guide to Machine Learning without Tears

RBI Unveils AI-Powered “Conversational Payments” for UPI Transactions

In an interesting move, the Reserve Bank of India (RBI) has announced its plans to integrate artificial intelligence (AI) into the realm of digital payments, particularly focusing on the Unified Payments Interface (UPI). The concept, known as “Conversational Payments,” introduces a dynamic and user-friendly approach to transactions. This new feature allows users to initiate payments seamlessly within chat or messaging conversations, transforming routine interactions into instant financial exchanges.

Other updates include, incorporating offline payments using NFC technology via ‘UPI-Lite‘ on-device wallet; and Elevating the transaction limit for small value digital payments offline, from Rs 200 to Rs 500, while retaining the overall limit of Rs 2000 per payment instrument. These strategic moves are poised to significantly extend and enhance the adoption of digital payments across the nation.

The RBI’s governor Shaktikanta Das said, “With the objective of harnessing new technologies for enhancing the digital payments experience for users, it is proposed to enable ‘Conversational Payments’ on UPI.” This technology-driven initiative aims to bring unprecedented convenience and efficiency to the payment landscape.

Industry experts have responded positively to the RBI’s announcement. Rahul Jain, Chief Financial Officer (CFO) of NTT DATA Payment Services India, believes that “Conversational Payments” will be a game-changer in the way users conduct transactions. He envisions a revolutionary process where AI, potentially in the form of chatbots, facilitates real-time conversations between users and payment providers, resulting in swift and secure transactions.

Mandar Agashe, Founder and MD of Sarvatra Technologies, applauds the central bank’s proactive measures. Agashe said that the introduction of “Conversational Payments” will further accelerate the adoption of UPI, making digital transactions more accessible and user-friendly for individuals seeking streamlined alternatives.

As the RBI pioneers AI-driven payment solutions, the financial landscape in India is set to undergo a transformation that brings the power of technology to the forefront of everyday transactions.

The post RBI Unveils AI-Powered “Conversational Payments” for UPI Transactions appeared first on Analytics India Magazine.

How To Speed Up SQL Queries Using Indexes [Python Edition]

How To Speed Up SQL Queries Using Indexes [Python Edition]
Image by Author

Suppose you’re sifting through the pages of a book. And you want to find the information that you’re looking for much faster. How’d you do that? Well, you’d probably look up the index of terminologies and then jump to the pages that reference a particular term. Indexes in SQL work similarly to the indexes in books.

In most real-world systems, you’ll run queries against a database table with a large number of rows (think millions of rows). Queries that require a full-table scan through all the rows to retrieve the results will be quite slow. If you know that you’ll have to query information based on some of the columns often, you can create database indexes on those columns. This will speed up the query significantly.

So what’ll we learn today? We’ll learn to connect to and query a SQLite database in Python—using the sqlite3 module. We’ll also learn how to add indexes and see how it improves performance.

To code along to this tutorial, you should have Python 3.7+ and SQLite installed in your working environment.

Note: The examples and sample output in this tutorial are for Python 3.10 and SQLite3 (version 3.37.2) on Ubuntu LTS 22.04.

Connecting to a Database in Python

We’ll use the built-in sqlite3 module. Before we start running queries, we need to:

  • connect to the database
  • create a database cursor to run queries

To connect to the database, we’ll use the

connect() function from sqlite3 module. Once we have established a connection, we can call cursor() on the connection object to create a database cursor as shown:

import sqlite3    # connect to the db  db_conn = sqlite3.connect('people_db.db')  db_cursor = db_conn.cursor()

Here we try to connect to the database

people_db. If the database doesn’t exist, running the above snippet will create the sqlite database for us.

Creating a Table and Inserting Records

Now, we’ll create a table in the database and populate it with records.

Let's create a table named people in the people_db database with the following fields:

  • name
  • email
  • job
# main.py  ...  # create table  db_cursor.execute('''CREATE TABLE people (                    id INTEGER PRIMARY KEY,                    name TEXT,                    email TEXT,                    job TEXT)''')      ...    # commit the transaction and close the cursor and db connection  db_conn.commit()  db_cursor.close()  db_conn.close()

Synthetic Data Generation with Faker

We now have to insert records into the table. To do this, we’ll use the Faker—a Python package for synthetic data generation—installable through pip:

$ pip install faker

After installing faker, you can import the Faker class into the Python script:

# main.py  ...  from faker import Faker  ...

The next step is to generate and insert records into the people table. Just so we know how indexes can speed up queries, let’s insert a large number of records. Here, we’ll insert 100K records; set the num_records variable to 100000.

Then, we do the following:

  • Instantiate a Faker object fake and set the seed so we get reproducibility.
  • Get a name string using first and last names—by calling first_name() and last_name() on the fake object.
  • Generate a fake domain by calling domain_name().
  • Use the first and last names and the domain to generate the email field.
  • Get a job for each individual record using job().

We generate and insert records into the people table:

# create and insert records  fake = Faker() # be sure to import: from faker import Faker   Faker.seed(42)    num_records = 100000    for _ in range(num_records):      first = fake.first_name()      last = fake.last_name()      name = f"{first} {last}"      domain = fake.domain_name()      email = f"{first}.{last}@{domain}"      job = fake.job()      db_cursor.execute('INSERT INTO people (name, email, job) VALUES (?,?,?)', (name,email,job))    # commit the transaction and close the cursor and db connection  db_conn.commit()  db_cursor.close()  db_conn.close()  

Now the main.py file has the following code:

# main.py  # imports  import sqlite3  from faker import Faker    # connect to the db  db_conn = sqlite3.connect('people_db.db')  db_cursor = db_conn.cursor()    # create table  db_cursor.execute('''CREATE TABLE people (                    id INTEGER PRIMARY KEY,                    name TEXT,                    email TEXT,                    job TEXT)''')      # create and insert records  fake = Faker()  Faker.seed(42)    num_records = 100000    for _ in range(num_records):      first = fake.first_name()      last = fake.last_name()      name = f"{first} {last}"      domain = fake.domain_name()      email = f"{first}.{last}@{domain}"      job = fake.job()      db_cursor.execute('INSERT INTO people (name, email, job) VALUES (?,?,?)', (name,email,job))    # commit the transaction and close the cursor and db connection  db_conn.commit()  db_cursor.close()  db_conn.close()

Run this script—once—to populate the table with num_records number of records.

Querying the Database

Now that we have the table with 100K records, let’s run a sample query on the people table.

Let’s run a query to:

  • get the names and emails of the records where the job title ‘Product manager’, and
  • limit the query results to 10 records.

We’ll use the default timer from the time module to get the approximate execution time for the query.

# sample_query.py    import sqlite3  import time    db_conn = sqlite3.connect("people_db.db")  db_cursor = db_conn.cursor()    t1 = time.perf_counter_ns()    db_cursor.execute("SELECT name, email FROM people WHERE job='Product manager' LIMIT 10;")    res = db_cursor.fetchall()  t2 = time.perf_counter_ns()    print(res)  print(f"Query time without index: {(t2-t1)/1000} us")

Here’s the output:

Output >>  [      ("Tina Woods", "Tina.Woods@smith.com"),      ("Toni Jackson", "Toni.Jackson@underwood.com"),      ("Lisa Miller", "Lisa.Miller@solis-west.info"),      ("Katherine Guerrero", "Katherine.Guerrero@schmidt-price.org"),      ("Michelle Lane", "Michelle.Lane@carr-hardy.com"),      ("Jane Johnson", "Jane.Johnson@graham.com"),      ("Matthew Odom", "Matthew.Odom@willis.biz"),      ("Isaac Daniel", "Isaac.Daniel@peck.com"),      ("Jay Byrd", "Jay.Byrd@bailey.info"),      ("Thomas Kirby", "Thomas.Kirby@west.com"),  ]    Query time without index: 448.275 us

You can also invoke the SQLite command-line client by running sqlite3 db_name at the command line:

$ sqlite3 people_db.db  SQLite version 3.37.2 2022-01-06 13:25:41  Enter ".help" for usage hints.

To get the list of indexes, you can run .index:

sqlite> .index

As there are no indexes currently, no index will be listed.

You can also check the query plan like so:

sqlite> EXPLAIN QUERY PLAN SELECT name, email FROM people WHERE job='Product Manager' LIMIT 10;  QUERY PLAN  `--SCAN people

Here the query plan is to scan all the rows which is inefficient.

Creating an Index on a Specific Column

To create a database index on a particular column you can use the syntax:

CREATE INDEX index-name on table (column(s))

Say we need to frequently look up the records of individuals with a particular job title. It’d help to create an index people_job_index on the job column:

# create_index.py    import time  import sqlite3    db_conn = sqlite3.connect('people_db.db')    db_cursor =db_conn.cursor()    t1 = time.perf_counter_ns()    db_cursor.execute("CREATE INDEX people_job_index ON people (job)")    t2 = time.perf_counter_ns()    db_conn.commit()    print(f"Time to create index: {(t2 - t1)/1000} us")      Output >>  Time to create index: 338298.6 us

Even though creating the index takes this long, it's a one-time operation. You will still get substantial speed-up when running multiple queries.

Now if you run .index at the SQLite command-line client, you’ll get:

sqlite> .index  people_job_index

Querying the Database with Index

If you now look at the query plan, you should be able to see that we now search people table using index people_job_index on the job column:

sqlite> EXPLAIN QUERY PLAN SELECT name, email FROM people WHERE job='Product manager' LIMIT 10;  QUERY PLAN  `--SEARCH people USING INDEX people_job_index (job=?)

You can re-run sample_query.py. Only modify the print() statement and see how long it takes for the query to run now:

# sample_query.py    import sqlite3  import time    db_conn = sqlite3.connect("people_db.db")  db_cursor = db_conn.cursor()    t1 = time.perf_counter_ns()    db_cursor.execute("SELECT name, email FROM people WHERE job='Product manager' LIMIT 10;")    res = db_cursor.fetchall()  t2 = time.perf_counter_ns()    print(res)  print(f"Query time with index: {(t2-t1)/1000} us")

Here’s the output:

Output >>  [      ("Tina Woods", "Tina.Woods@smith.com"),      ("Toni Jackson", "Toni.Jackson@underwood.com"),      ("Lisa Miller", "Lisa.Miller@solis-west.info"),      ("Katherine Guerrero", "Katherine.Guerrero@schmidt-price.org"),      ("Michelle Lane", "Michelle.Lane@carr-hardy.com"),      ("Jane Johnson", "Jane.Johnson@graham.com"),      ("Matthew Odom", "Matthew.Odom@willis.biz"),      ("Isaac Daniel", "Isaac.Daniel@peck.com"),      ("Jay Byrd", "Jay.Byrd@bailey.info"),      ("Thomas Kirby", "Thomas.Kirby@west.com"),  ]    Query time with index: 167.179 us

We see that the query now takes about 167.179 microseconds to execute.

Performance Improvement

For our sample query, querying with index is about 2.68 times faster. And we get a percentage speedup of 62.71% in execution times.

You can also try running a few more queries: queries that involve filtering on the job column and see the performance improvement.

Also note: Because we have created an index only on the job column, if you are running queries that involve other columns, the queries will not run any faster than without index.

Wrap-Up and Next Steps

I hope this guide helped you understand how creating database indexes—on frequently queried columns—can significantly speed up queries. This is an introduction to database indexes. You can also create multi-column indexes, multiple indexes for the same column, and much more.

You can find all the code used in this tutorial in this GitHub repository. Happy coding!
Bala Priya C is a developer and technical writer from India. She likes working at the intersection of math, programming, data science, and content creation. Her areas of interest and expertise include DevOps, data science, and natural language processing. She enjoys reading, writing, coding, and coffee! Currently, she's working on learning and sharing her knowledge with the developer community by authoring tutorials, how-to guides, opinion pieces, and more.

More On This Topic

  • 3 Simple Ways to Speed Up Your Python Code
  • Database Optimization: Exploring Indexes in SQL
  • Deep Learning with Python: Second Edition by François Chollet
  • Introduction to Statistical Learning, Python Edition: Free Book
  • 5 Tricky SQL Queries Solved
  • 4 Useful Intermediate SQL Queries for Data Science