Here for the API?Start building with us today

Learn about DeCommas API
The Hurdles for Introducing AI in Defi at Scale
August 11, 2023

The Hurdles for Introducing AI in Defi at Scale

TL;DR

At DeCommas, the ongoing mission is to enhance defi accessibility through innovative solutions. Prior to this, DeCommas crafted web3 tools like Swap, Pathfinder, and Portfolio to make defi more user-friendly. With the AI uprising, a trend emerged, encouraging us to develop the innovative “Text to Transaction” (TTT) interface. TTT acts as a smooth connection between users and defi platforms. It helps them easily swap just by writing. For example, writing a simple request for “10 eth on optimism to eth on arbitrum” would trigger appropriate chains and coins by these keywords.

Despite the enthusiasm, DeCommas` journey into GPT-powered TTT interfaces posed unforeseen challenges due to AI biases, highlighting the need for better development from both sides to avoid any inconvenience . The goal of DeCommas was to combine the convenience of ChatGPT with users’ needs in defi. That’s how TTT development began. The starting point was our vision, letting users make transactions through easy and intuitive search interactions. Let’s wrap it up.

The Vision: Transforming Defi Interaction

The goal was clear: to enable users to interact with defi UI using their own words. Imagine a future where you can start complicated crypto actions just by texting simple instructions. No more confusing menus or commands to deal with, where you have to swap, bridge, switch networks, change wallets. Due to these hurdles people can lose any motivation on their way of just sending crypto somewhere. That’s how TTT`s vision came to life.

The Approach: Using GPT for Advanced Command Processing

To translate the vision into reality, DeCommas integrated OpenAI’s Generative Pre-trained Transformers (GPT) at the core of DeCommas` processing. In these tests with TTT DeCommas utilized GPT models from generations GPT3.5, and GPT4 via API, with a main focus on the 3rd generation, for the sake of speed of response, as it has less info to deal with, therefore faster responses. Complex user inputs like “I want to swap token XYZ to ABC ‘’ would be processed by GPT’s natural language capabilities via its API. The generated JSON responses would seamlessly integrate with DeCommas` UI, automating defi actions.

The Challenge: Overcoming bias in GPT

Despite making progress in backend development and UI design, real-world testing revealed a bias in the GPT API. This bias leans toward tokens and concepts familiar only up until mid-2021, making it difficult for users to use as intended. For instance, due to this bias, the API tends to overemphasize $BSC and $CAKE-related content, limiting its relevance for users seeking broader information beyond that scope. That’s why the GPT API tried to fill empty fields with $BSC or $CAKE while testing. Addressing this bias is crucial to offer a more current and well-rounded user experience to make work for users.

Lessons and Future Prospects

  • DeCommas journey was not for nothing; it has provided us with invaluable insights:

a. Bias Awareness: The discovery of bias in AI models reminds us to always stay alert and take active steps to address this challenge. Making AI development transparent and inclusive should stay a top priority.

b. Resilience and Progress: The initial attempt at TTT interfaces faced challenges, but the concept remains exciting. Making it accessible through the API & SDK adds to the excitement. As AI advances and lessons are learned from past mistakes, the original goal is still being pursued, despite encountering obstacles. The progress made by Open AI, including expanding the database, resolving bugs, and updating previous datasets, holds promise for positive change for us too.

c. Web3 x AI Synergy: Combining AI and blockchain (Web3) opens up a lot of possibilities. DeCommas is focusing on blending AI and blockchain at the API level in the DeCommas Mission Control API, so developers from different fields can easily add TTT capabilities to their apps.

Numerous attempts were made to address these challenges within half a year, yet they remained unsuccessful. Initially, our development team came to the idea of an independent library, which was developed to bypass the use of GPT. Then, development efforts were directed toward formulating effective prompts for GPT.

Lately, attempts have been undertaken to generate a learning dataset, which was stored within a vector database, which is a purpose-built database specialized in tackling the problems that arise when managing vector embeddings in production scenarios. The culmination involved integrating the dataset from the vector database with the langchain framework, which is designed to simplify the creation of applications using large language models, combining it alongside GPT and a carefully crafted prompt.

Conclusion

DeCommas’ search to lead in developing the GPT-powered TTT interface has shown us the challenges of AI bias and tech blending. This journey highlights the need for ongoing work to make fair and inclusive AI. After this internal testing and the insights received, our curiosity grew to explore open-source & tweakable LLMs(Large Language Models), as well as arising new GPT competitors, such as Claude 2 via API.

Currently, TTT is an additional goal for DeCommas’ development, alongside the ongoing development of the DeCommas Mission Control API. Such an interface or search bar will still be implemented over time, but for now, we are saving this idea for later stages**.** DeCommas continues its experimentation with AI integration into Web3, but now it is directing its focus toward developing the DeCommas Mission Control API, enabling others to use it in their development.

If you enjoyed this article and want to see more like these, share your thoughts on Discord general chat and follow us on Twitter!