iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
🧷

Differences Between Software and AI Product Development: Insights from 'Building Your Own Product Copilot'

に公開

There is a research paper that summarizes interviews with 26 software engineers involved in the development of AI products, published by Microsoft.

Even a quick read felt deeply resonant. It seemed well-summarized for understanding the characteristics of AI product development and the overall scope of challenges from a software engineer's perspective, so I decided to summarize it as I read.

https://www.microsoft.com/en-us/research/publication/building-your-own-product-copilot-challenges-opportunities-and-needs/

Summary

Many companies are trying to incorporate AI assistant features into their products, but integrating AI into a product is a first-time experience for many software engineers, and existing development processes and tools are not fully equipped to handle the challenges associated with developing AI-powered applications.

Building Your Own Product Copilot is a research paper that summarizes challenges and needs by conducting interviews and brainstorming sessions with 26 software engineers involved in the development of AI assistants.

As a side note, the recruitment method for interview participants was as follows. The focus is on software engineers involved in developing AI features, rather than those just using AI in their development process or those with a background in data science and machine learning.

  • Recruitment Methods
    1. Internal Recruitment at Microsoft
      • Directly recruited 14 software engineers
      • Known individuals involved in Copilot development
    2. External Recruitment
      • Used UserInterviews.com
      • Recruited 12 software engineers from diverse companies and fields
  • Selection Criteria
    • Used a survey consisting of 20 questions
    • Exclusion Criteria:
      • Engineers using AI only in their development process (e.g., only using GitHub Copilot or ChatGPT)
      • Individuals with an extensive background in data science or machine learning
    • Inclusion Criteria:
      • Individuals spending more than 20 hours per week on AI-related features or product development

Main Differences and Challenges

The main challenge themes identified from the interviews are as follows.
In particular, prompt engineering and testing were found to require significant time and resources.

Category Challenges
Prompt Engineering - Time-consuming trial-and-error process
- Lack of consistency in model output
- Balance between context and token limits
- Cumbersome prompt management
Orchestration - Creating complex workflows
- Managing unpredictable behavior
- Managing multi-turn conversations
- Handling cases where the model loops or goes off-track
Testing and Benchmarking - Difficulty in applying traditional unit tests
- Lack of standardized benchmarks and evaluation metrics
- Need for custom testing solutions
Safety, Privacy, and Compliance - Concerns about real-world impact
- Need for user consent and understanding
- Responsible AI
Evolving Knowledge and Best Practices - Lack of systematic learning materials and best practices
- Dependence on community-led learning
- Need for an approach different from traditional software development
Developer Experience - Gap between tools for prototype development and product development
- Difficulty in project setup and integration

Prompt Engineering

First, prompt engineering is mentioned in the research findings.

Prompt engineering is an unknown territory compared to the software engineering that interviewees are accustomed to; one interviewee described it as "more of an art than a science."
While they expressed some bewilderment at dealing with the unpredictable nature of LLM models, they also showed positive reactions toward how the generalizability of these models has expanded the range of achievable scenarios.

Let's look at the main challenges of prompt engineering in more detail.

Challenge Description
Time-consuming trial-and-error process • Requires experiments in ad-hoc environments
• Demands significant time and effort
• Lack of efficient methodologies
Controlling prompt output • Difficulty in obtaining output in structured formats
• Challenges in generating consistent responses
• Need to handle unexpected output formats
Balance between context and token limits • Providing sufficient context within limited token counts
• Necessity to compress large amounts of information
• Difficulty in deciding which information to select or remove
Prompt management and tracking • Complexity in decomposing and managing prompts
• Necessity of version control
• Difficulty in continuous verification and tracking of performance
Model instability • Unstable responses from large language models
• Handling unpredictable behavior
• Need for adjustments tailored to model characteristics
Lack of tools • Lack of tools to support efficient prompt engineering
• Difficulty in integrating with existing software development tools

Time-consuming trial-and-error process

The initial phase of prompt engineering often begins with experiments in ad-hoc environments like OpenAI's Playground.
Many interviewees stated that they perform prompt engineering by trying various inputs in the Playground to explore what works.

While opportunities to write prompts from scratch have decreased slightly in various scenes recently, the exploratory nature of the process is highly relatable.

Controlling prompt output

Unless the LLM output is displayed directly to the end user, developers typically want to obtain output in some structured format that is easy to handle within a system or program.
Many interviewees tried outputting in JSON or Markdown formats, but they seemed to struggle with handling cases where broken JSON was returned.

Balance between context and token limits

While the sense of this challenge has diminished recently due to the significant expansion of context windows, it refers to the dilemma of wanting to provide as much context as possible versus token limits.

  1. Understanding context from short instructions (e.g., "Refactor this code")
  2. Compressing large amounts of information into a limited number of tokens
  3. "Selectively discarding" information as needed

Prompt management and tracking

Topics included how to decompose prompts, effective prompt templates, management methods, and the need for experiment management tools to continuously evaluate prompts.
Experiment management tools are frequently discussed by companies in Japan, and with more options available, they seem to have gained significant mainstream acceptance.

  1. Initial problem: "It's a mistake to try to do too many things with a single prompt"
  2. Solution: Decomposing prompts into examples, instructions/rules, templates, and other assets
  3. Result: "A sort of prompt library is created"

Personally, regarding the point about "creating a sort of prompt library," I recalled creating my own custom prompt libraries in the early days, which made me feel nostalgic.

Orchestration

In most products, orchestration and evaluation of multiple prompts are necessary, and it is rare for everything to be completed with a single prompt. Nowadays, flow engineering would likely be a closely related theme.

Concept/Challenge Description
Intent Detection and Routing • Detect intent from user input
• Route to the appropriate prompt
• Requires response interpretation and post-processing
Command Function Limitations • Command execution is restrictive in many Copilots
• Cautious about automatic execution from a safety perspective
Long-term Dialogue and Planning • Difficult to extend from single-turn to multi-turn dialogue
• Solutions using agent-based approaches
Loops and Derailment • Models easily fall into loops or drift away from the task
• Accurate recognition of task completion is difficult

Testing and Benchmarking

Similar to prompt engineering, testing and benchmarking are said to have consumed significant time and resources.

Recently, approaches like LLM as a Judge have been increasing as a methodology.
https://www.brainpad.co.jp/doors/contents/01_llm_as_a_judge/

Also, metamorphic testing, a technique focusing on pass/fail criteria and structure rather than just content, is introduced.
https://qiita.com/tokumoto/items/cd3d17cae3b099badaf6

Challenge Description
Flaky Test Problem • Generative model responses differ every time
• Traditional assertion-based testing is difficult
• Lack of consistency in results
Test Data Management • Large datasets of manually curated input/output examples are required
• Difficulty in updating as prompts or models change
Absence of Benchmarks • Lack of standardized benchmarks
• Each team needs to create their own benchmarks
Unclear Evaluation Metrics • Lack of clear criteria to define "good enough" performance
• Difficulty in evaluating performance improvements
Challenges in Manual Labeling • Creation of large labeled datasets is required
• Time-consuming and costly work
Resource Constraints • High cost of test execution
• Difficulty in running large test suites

Safety, Privacy, and Compliance

The importance of guardrails and moderation increases, especially for conversational services that accept free-form input from end users. Regarding the balance between telemetry and privacy, while it's true that being able to check inputs and outputs makes development more efficient from a developer's perspective, having "no restrictions at all!" doesn't seem realistic. How to strike that balance likely depends on the specific domain and its sensitivities.

Challenge Description
Ensuring Safety • Setting up guardrails to protect user safety
• Preventing unintended harmful dialogues
• Guaranteeing safety across a wide range of usage environments
Controlling Dialogue • Preventing transitions into inappropriate topics
• Implementing content filtering
• Using rule-based classifiers and manual guard-lists
Privacy Protection • Preventing leakage of personally identifiable information (PII)
• Data protection when using third-party models
• Risk mitigation through hosting internal models
Balance between Telemetry and Privacy • Balancing understanding of user behavior with privacy protection
• Constraints on functional improvement due to limited data collection
• Difficulty in evaluating the quality of generated content
Responsible AI Evaluation • Comprehensive review of compliance and safety
• Complex and time-consuming evaluation processes
• Need for new evaluation criteria and methodologies
Detecting Harmful Content • Automatic detection of various categories of harmful content
• Building large and complex filtering systems
• Necessity of meeting strict criteria before shipping

Developer Experience

To sum it up very briefly, the development ecosystem and tools are still in their infancy. While the number of options has increased recently, it feels like more time is now being spent on learning and comparing these tools...

Challenge Description
Early Adoption of Rich Ecosystems • Choosing libraries with extensive features (e.g., LangChain) for prototype development
• Different approaches are required during actual product development
Burden of Learning Tools • Time consumed in learning and comparing diverse tools
• Wanting to focus on customer problems but being preoccupied with learning tools
• Feeling of fatigue in navigating the tool ecosystem
Lack of Systematic Design Processes • Lack of workflows to decompose and develop individual components
• Need for features to define pre-conditions and post-conditions for prompts individually
• Demand for built-in verification features
Absence of Integrated Workflows • Lack of integrated workflows combining prompt engineering, orchestration, testing, benchmarking, performance, and telemetry
• Necessity of combining various diverse tools

Conclusion

Although published in December 2023 and some things have changed since then, most of the points remain relevant as challenges or characteristics today. I felt that many of them were easy to understand and communicate as differences from traditional software engineering. I have mostly omitted the proposed solutions and methodologies for these challenges this time, so if you are interested, please check out the original paper.

For reference, here is the high-level development flow diagram resulting from the interviews.

Quote: 3.2.Procedure - Building Your Own Product Copilot: Challenges, Opportunities, and Needs

Although slightly off-topic from this post, we are awaiting changes in the development process brought by GitHub Copilot, Cursor, Replit Agent, v0, GPT Engineer, and Devin (which is still on a waitlist with no news), so it seems like things will continue to be exciting.

That's all for now!

Discussion