Exploration Through Example
Friday, February 7, 2025
Wednesday, March 13, 2024
Unleashing the Potential: Modern Techniques to Boost Large Language Model Performance
1. Retrieval-Augmented Generation (RAG):
Imagine an LLM that can not only generate text but also access and leverage relevant information from external sources. This is the core idea behind RAG models. RAG combines an LLM with a retrieval system that fetches information pertinent to the task at hand. The LLM then utilizes this retrieved information to enhance its generation process, leading to more factually accurate and informative outputs.
2. Chaining Transformers:
LLMs are often monolithic beasts, tackling entire tasks in one go. Chaining Transformers breaks down complex tasks into smaller, more manageable subtasks. Each subtask is handled by a specialized transformer model, and the outputs are sequentially chained together to achieve the final goal. This approach allows for more efficient training and potentially better performance on intricate tasks.
3. Prompt Engineering:
Think of prompts as instructions that guide an LLM towards the desired outcome. Prompt engineering focuses on crafting effective prompts that steer the LLM in the right direction. By carefully designing prompts that incorporate task-specific information and desired outcomes, researchers can significantly improve the quality and accuracy of LLM outputs.
4. Transfer Learning and Fine-tuning:
Pre-trained LLMs have learned a wealth of knowledge from massive datasets. Transfer learning and fine-tuning techniques leverage this pre-trained knowledge as a starting point for new tasks. By fine-tuning an LLM on a task-specific dataset, researchers can significantly reduce training time and improve performance compared to training from scratch.
This blog post has just scratched the surface of the exciting advancements in LLM technology. In future posts, we'll delve deeper into each of these techniques, exploring their specific applications and showcasing their potential to revolutionize various AI domains.
Wednesday, October 19, 2022
Easy setup Kibana Nginx reverse proxy with Ansible
Motivation
Amazon OpenSearch Service cluster instance run inside a virtual private cloud. If you want to access Kibana dedicated to this instance you have two options. One is tunneling to EC2 bastion host which is realitvely straightforward. One of the disadvantages of this approach is that you need to share your bastion host keys to clients. Another is reverse proxy on bastion host to private OpenSearch Kibana. In this example, we are going to show how you can setup access to Kibana using Nginx reverse proxy and provision it with Ansible.
This example represent basic setup which can serve as basis for future improvements. This basis don't include secure access configuration (certifications, authentication). It uses HTTP between client and proxy server, for production environment using HTTPS is recommended in this context. It's an easier setup, but for other hand it's also less secure setup.
Example
Inventory
First you need to have inventory defined with one variable (open_search_endpoint) which should point to Kibana instance. Notice, we have two ec2 instances in our inventory. One can be for production environment, second for staging for example.
Main playbook
Next we are going to define main Ansible playbook, which is pretty straight forward. For it to work, you need to have configuration files (default.config and ngnix.config) located in your path.
Default configuration
For default.config, we are using simple proxy pass. If you want more secure connection, this is where you would configure HTTPS.
Nginx configuration
Thursday, August 4, 2022
Serverless React, AWS Lambda and API Gateway example
Here is small terraform example how you can create serverless React app that will use AWS API Gateway which will call AWS Lambda.
API Gateway is proxying GET request to lambda. Lambda will simply return "Hello World".
Actual terraform infrastructure definition. This terraform definition include CORS configuration.
Lambda which that will return "Hello World".
Thursday, April 28, 2022
ALB rule based routing with terraform
Tuesday, January 28, 2020
React.js PDF export
Saturday, March 2, 2019
Python script to find structure of opportunities on Slovakia job market
Introduction
I will try to answer this simple question using google colab + python notebook + web crawling Slovak job ad site + simple NLP (mainly using regex and simple text transformations) and pandas with sklearn.
It's impossible to answer this question using something like TIOBE programming index. This index is composed using trend searches in popular search engines. It doesn't take into consideration what is actual demand for some programming language on job market, let alone niche market like Slovak.
How is this possible?
This is possible now due to change of law on Slovak job market, which basically force companies to publish lowest possible salary they are willing to pay for position. Companies tends to put higher figures in ads, to compete with each other. So real salaries are bit higher, but it should average itself out. There is one problem tough. There is no regulation what type of salary they should put on ad, so there are companies that put net salary and other put gross salary. But. there are not so many of those that put gross salaries.
Data
For correctness, jobs with salary lower than 900 and bigger than 5500 EUR will be ignored, because there is higher probability they are false positive.
We will crawl most popular Slovak job ad site. Crawler will crawl through roughly 1200 pages of IT jobs. Some of which are full programming jobs, others are something in between (Managers, Support, Testers)
We will use corpus of words that will represent most popular programming languages. There will be tree different strategies for parsing programming languages from ad text. You shouldn't worry to much about this. Main reason for this it's difficulty to parse words like "C" or "R" programming languages from ad text, so we must treat it as single word that have no word boundaries.
Python scripts
Here is link to read only google colab python notebook without crawl code (code that actually rip/downloads content from job ad site)Click here to see the scripts
Summary
As you can see there are some interesting surprises. Java is main language to learn if you want to make between 3000 and 4000 Euros.
Who knew bash is so important to learn? But on other hand is not so hard to learn it. :)
For lower paying positions PHP is main language, but you can also see there R at second spot (maybe some error in parsing?)
It no surprise that for higher salaries than 4000 EUR there is no clear winner. You must be generalist at these positions (Architects, Team Leads, Tech Leads). So answer to the question in title is: None, or there is not silver bullet, just be good at what you do and make sure to learn as much as you can.
Monday, August 13, 2018
Serverless Architectures
Serverless Architectures
SA are new approach to application designs. This is hot topic in the software architecture world right now. All "Big Three" (Amazon, Google, Microsoft) are heavily investing in "Serverlessnes" right now.
What is it?
Upsides and downsides
Upsides:
- No need for system administration (everything is handled by third party)
- Decreases complexity of your product
- Natively micro service architecture.
- Lesser cost to scale.
- Elasticity - native scaling
- Smaller development and operational costs
- Decrease time to market
Downsides:
- Debugging and monitoring is still and issue.
- Tooling is not there quite yet.
- Cold start issues.
Tuesday, March 27, 2018
Truffle execute external script call contract function
* Error: VM Exception while processing transaction: out of gas
* Error: Cannot create instance of YourContract; no code at address
* Error: sender account not recognized
* Error: invalid address
If you get some of these errors while trying to execute contract function from truffle script, here is proper way to do it:
Monday, March 26, 2018
Truffle external scripts working example
errors:
TypeError: Cannot read property 'apply' of undefined
exception at require.js:128:1
TypeError: fn is not a function
For some reason it was quite difficult to find solution how to run external script. After some time I finally have figure it out so I'm sharing it with world: