TrueLaw chose DSPy due to its modular nature, ease of customization, and better object hierarchy, which allowed for more efficient and transparent query rewriting and iterative improvements.
Fine-tuning is necessary for domain-specific tasks in legal AI because off-the-shelf models often lack the precision and quality required by lawyers, who are not skilled prompt engineers. Fine-tuning helps contextualize queries and align the output with the firm's specific expectations.
Embedding model fine-tuning is cost-effective because the models are relatively small and the main cost is generating contrastive data, which is cheaper compared to training large models from scratch.
TrueLaw decided to use SaaS providers for infrastructure to leverage existing services, reduce costs, and focus on their core IP, which is data generation and fine-tuning. This approach is more efficient and scalable, especially for a startup with resource constraints.
TrueLaw chose Temporal for managing long-running workflows because it provided a robust and flexible workflow engine that handled retries, interruptions, and notifications, which would have taken significant time and effort to build in-house.
Shiva believes his broad experience has been beneficial because it allows him to draw parallels between seemingly unrelated areas, apply fundamental principles across different domains, and understand the core concepts that are universally applicable in solving performance and system-level issues.
Shiva Bhattacharjee) is the Co-founder and CTO of TrueLaw), where we are building bespoke models for law firms for a wide variety of tasks.
Alignment is Real // MLOps Podcast #260 with Shiva Bhattacharjee, CTO of TrueLaw Inc.
// Abstract If the off-the-shelf model can understand and solve a domain-specific task well enough, either your task isn't that nuanced or you have achieved AGI. We discuss when is fine-tuning necessary over prompting and how we have created a loop of sampling - collecting feedback - fine-tuning to create models that seem to perform exceedingly well in domain-specific tasks.
// Bio 20 years of experience in distributed and data-intensive systems spanning work at Apple, Arista Networks, Databricks, and Confluent. Currently CTO at TrueLaw where we provide a framework to fold in user feedback, such as lawyer critiques of a given task, and fold them into proprietary LLM models through fine-tuning mechanics, resulting in 7-10x improvements over the base model.
// MLOps Jobs board https://mlops.pallet.xyz/jobs
// MLOps Swag/Merch https://mlops-community.myshopify.com/
// Related Links Website: www.truelaw.ai
--------------- ✌️Connect With Us ✌️ ------------- Join our slack community: https://go.mlops.community/slack Follow us on Twitter: @mlopscommunity Sign up for the next meetup: https://go.mlops.community/register Catch all episodes, blogs, newsletters, and more: https://mlops.community/
Connect with Demetrios on LinkedIn: https://www.linkedin.com/in/dpbrinkm/ Connect with Shiva on LinkedIn: https://www.linkedin.com/in/shivabhattacharjee/
Timestamps: [00:00] Shiva's preferred coffee [00:58] Takeaways [01:17] DSPy Implementation [04:57] Evaluating DSPy risks [08:13] Community-driven DSPy tool [12:19] RAG implementation strategies [17:02] Cost-effective embedding fine-tuning [18:51] AI infrastructure decision-making [24:13] Prompt data flow evolution [26:32] Buy vs build decision [30:45] Tech stack insights [38:20] Wrap up