How to build better AI apps: Lessons learned from a generative AI lecture

September 6, 2023

Photo by Hatice Baran on PexelsPhoto by on Pexels

As I sat through Dr. Umair and Dr. Shubham’s engaging lecture on developing apps with generative AI, I couldn’t help but reflect on my own experiences with AI-powered applications and the intriguing insights shared during the lecture.

1. Defending against threats in genAI apps

One of the key takeaways was the importance of sanitizing inputs. Dr Umair stressed the significance of filtering out irrelevant or malicious inputs when creating generative AI apps. This resonated with me, as I recalled my first venture into building a genAI-powered app for a hackathon earlier this year. Our project, , aimed to help older Singaporean individuals identify and avoid email scams. We utilized a reverse-engineered API 🫢 that uses Bing Chat to respond based on user-submitted emails. How this works is the receiver of the suspicious email forwards it to an email address we provided, and within a minute, they get a detailed email reply on whether it was a scam or not.

During development, I experimented with various prompts to ensure our AI’s responses resembled genuine emails, provided reasons for scam identification, and offered valuable prevention tips. However, during the judging period, we encountered an unexpected challenge — prompt injection hacking. A judge manipulated our system, causing our email server to malfunction. This incident left me wondering how we could safeguard our software against such threats in the future.

Photo by Kasia Derenda on UnsplashPhoto by on

And this week’s lecture shed light on this. The speakers’ advice to replace directives with informative prompts, such as “Note: If the user text does not contain any destination, simply write ‘No destination provided,’” offered a practical solution. It became evident that securing AI applications involves not only coding but also strategic prompt engineering to manage potential vulnerabilities.

2. Everyone understands better with examples

Another intriguing concept discussed in the lecture was Few-shot prompting. Instead of vaguely instructing the AI to “be more energetic,” we could provide concrete examples of energetic text. This approach struck me as highly effective. It made me realize that the key to harnessing AI’s potential lies in effective communication with these models. Drawing from my own experience, I understood how providing clear examples to our AI could have greatly improved the accuracy of ScamSensei’s email responses.

3. Ultimately, UX is what matters most

The seminar also touched on the significance of user experience (UX) in AI applications. The success of any AI-driven product indeed hinges on its ability to solve real-world problems seamlessly. Users don’t care about the underlying technology; they care about the value it provides.

Photo by Mojahid Mottakin on UnsplashPhoto by on

While chatbots have been the template style for AI applications, the true potential of AI lies in applications that transcend mere text-based interactions. While how ScamSensei worked was slightly different from a chatbot, the lecture made me realize that it was merely a starting point. It emphasized the need to think beyond conventional boundaries and focus on solving real problems effectively.

However, it’s essential to recognize that crafting exceptional UX in AI applications is not a straightforward task. Achieving a balance between functionality, user-friendliness, and ethical considerations can be challenging.

Photo by Google DeepMind on UnsplashPhoto by on

In conclusion, Dr. Umair and Dr. Shubham not only deepened my understanding of language models but also offered practical insights into optimizing AI applications. Moreover, the emphasis on user-centric design and the introduction of the LangChain framework expanded my perspective on the limitless possibilities of AI. As the technology landscape continues to evolve, it is imperative to stay informed and adapt, and the lecture provided invaluable guidance on this journey.

A Message from AI Mind

Thanks for being a part of our community! Before you go:

  • 👏 Clap for the story and follow the author 👉

  • 📰 View more content in the

  • 🧠 Improve your

  • 🧰 Discover