Traditional AI — Use Case is All You Need!

Heting Li
5 min readApr 25, 2024

--

Baskin Creative Studios

1.Introduction

After completing our previous tutorial on Traditional AI Development Environment Setup, you now possess your very own private development environment! Are you ready to start on building your AI program? If you lack experience with Python or knowledge with AI libraries, Do Not Worry! We can utilize AI to assist us in AI programming.

2. How does AI Generate Code? (Optional Read)

AI Code Generator uses the Fine-Tuned LLM Model as a Back-End, which was trained with massive data from open-source Code/Commit Repos, following the “Instruction-Answer Pairs” driven by the LLM Fine-Tune process.

On the other side, the extensions in the VSCode query the AI Code Generator service providers’ Front-End via API, constructed by the supported “Instruction-Input Pairs”. The “Instruction” includes scenarios for example Generate code, Examine Code, Add Comment, Add Test, Explain the code, etc. And the “Input” includes scenarios for example: Use Case description in text, Code which require adjustment, or any other inquries.

Below diagram provides a high level overview about the concept of the AI Code Generator process.

3. Experiment

Let us continue to use our favorite example Classification: Recognizing hand-written digits. Instead of reusing the default Scikit-Learn code, let us just try to ask AI help us to program it from scratch, and probably integrate with more AI models for comparison. Let us explore two options:

Web-based ChatGPT, Either ChatGPT 3.5 or 4 fulfill our needs.

AI Code Generators in VSCode, by installation of extensions in VSCode, including ChatGPT, Copilot, Codium, Codiumate, Amazon codewhisperer

3.1 Use Web-Based ChatGPT to Generate Code

Let us try to ask the web-based ChatGPT to develop the use case of Recognizing hand-written digits on behalf of us, with following inquiries one-by-one:

1) Help me build a model to train and predict based on scikit-learn dataset datasets.load_digits

2)Try use other models?

3) Can you provide a jupyter notebook file for me to download? (This step requires ChatGPT4 which need an upgraded subscription)

The outcome is promising! ChatGPT can generate a complete Jupyter Notebook including multiple AI models that are supported by Scikit-Learn.

After download the Jupyter Nodebook from ChatGPT and execute it in our private environment which was established during Traditional AI Development Environment Setup, it works just like a charm! And we are able to quickly compare the performance across different models for the use case of Recognizing hand-written digits !

3.2 Use AI Code Generators in VSCode

While the web-based ChatGPT is quite capable, its effectiveness is limited by its lack of integration with our development environment. Let’s explore the use of AI Code Generator Extensions in VSCode to generate the code for recognizing hand-written digits.

Step 1: In VSCode Go the “Extensions” menu

Step 2: Search for AI Code Generator Extension you want to use. The popular ones are ChatGPT, Copilot, Codium, Codiumate, Amazon codewhisperer

Step 3: After Extension installation finish, they will be enabled automatically and shown up as an icon on the left side bar.
Note: These extensions can function simultaneously for the majority of their features, but please be noted of exceptions as indicated by the prompt.

Step 4: Click the AI Code Generator’s icon on the left. Take “Codium” for example, let us send the same inquiries as we did for the ChatGPT. A few coding blocks will be generated, then we click the “Insert” to move code to our file.

The code generated by Codium is similar and a lit bit simpler than the ChatGPT, the code is also qualified and can be executed without any problem. However, all the extensions does not support generation of Jupyter Nodebook except for ChatGPT4.

Step 5: Try the code assistance capabilities. Take “Codium” for example, select a few lines of code and right click, the pop-up menu of Codeium’s will guide us further to other code assistance actions.

4. Conclusion

Use Case is All you Need!

Our ideas of AI Use Cases could be implemented from scratch within just a few minutes! Thanks to the Generative AI Model that are integrated within our development environment.

There exist a significant similarity and diversity among these AI Code Generators that are worth exploring. A base assessment of the tools is provided below solely based on our code generation exercise in this Tutorial.

It’s important to recognize that these tools are evolving rapidly. Furthermore, the strengths and weaknesses of each tool largely depends on the capabilities of the initial LLM model and how the backend LLM model was fine-tuned, and this process is continuously advancing.

5. What is Next Step?

Although the AI Code Generator could assist us on programming, the full-fledged AI Driven Development process is still constrained by AI Code Generator maturity and Industrial confidential boundaries. Furthermore, the Data Preprocess still demand significant human intelligence, while during this Tutorial, we had simply inherited the Scikit-learn pre-processed datasets.load_digits

Therefore, it necessitates our knowledge about AI Models and development techniques. So let us continue the Tutorials: Traditional AI — Start with Scikit-Learn: User Guide(Under Preparing) to have more insights about the AI Models, and on the journey we will be able to effectively build the sufficient coding competence which will be eventually fully assisted by AI.

--

--