Suramya's Blog : Welcome to my crazy life…

September 7, 2023

Youtube2Webpage: Create Websites with Text from Videos

In my last post, I had talked about preferring text content to videos and coincidentally my Hacker News feed happened to cover a tool that takes a video link and creates a webpage with a transcript generated from the video’s closed captions paired with screenshots of the video. The program is called Youtube-to-Webpage. It is a Perl script that uses yt-dlp & ffmpeg to do the processing.

I tried it out using the curl video I talked about in the previous command as the input and the software did a decent job capturing the details. The output is very plain and looks like the following:

Transcription of Curl Training video
Transcription of Curl Training video

Since the program uses the built-in YouTube captions for getting the text from the video, the transcription is only as good as how good the captions are. One enhancement, that could make it better is to use a Speech-to-Text engine and use that text in the output. The slightly tricky part would be to match the screenshots with the audio/transcription timestamps.

Check it out if you prefer to read text instead of videos. I wonder how the output would look if we feed this to a LLM and ask it to make it like an article. That can be something we can explore for the next post 🙂

– Suramya

August 31, 2023

Using LLM’s to change writing style to hide author?

Filed under: Artificial Intelligence,My Thoughts,Tech Related — Suramya @ 12:17 PM

It is fairly well known that folks can identify a writer based on their writing style. In fact there is a whole field of work called Stylometry that analyses writings to try to attribute authorship of documents/writings. This is used in when new text/writings are found that are not attributed to any person or when agencies receive letters or there are articles posted on extremist sites.

In 1964, Frederick Mosteller and David Wallace published a three-year study of the distribution of common words in the Federalist Papers and showed that the writing style of Alexander Hamilton and James Madison differed in subtle ways. The researchers analyzed some disputed papers that both writers claimed to have written and based on their analysis of the respective writing styles of both authors were able to identify that the papers were likely to have come from Madison’s pen. Since then the technique has only improved, with AI and Machine learning algorithms coming into play researchers are able to identify the writing style from a post quickly and mostly accurately. Keep in mind that this is still more of an art than a science. However, it works well enough that people were able to identify the author of a book: “The Cuckoo’s Calling, by Robert Galbraith” as none other than JK Rowling.

Now, as we all know “With every action there is an equal and opposite reaction” and there has been a lot of work put into what is called Adversarial stylometry. Which is the practice of consciously changing the writing style when writing so remove the identifying characteristics that can be used to figure out who wrote the text. Historically, this was achieved by paraphrasing the text and by having another person edit & modify the content.

With the recent advances in LLM especially systems like ChatGPT it might be possible to use them to whitewash the text and remove enough identifying marks that the text becomes relatively more anonymous. I tried it out with the previous paragraph as the input and got the following as the result:

As commonly understood, the principle of “For every action, there is an opposing reaction” holds true. Considerable effort has been dedicated to a field known as Adversarial Stylometry. This involves intentionally altering one’s writing style to eliminate distinctive traits that could be employed to determine the authorship of a text. In the past, this was accomplished by rephrasing the content and enlisting the assistance of a third party to revise and adjust the material.

As you can see the output is significantly different in both words, tone and phrasing that it would it hard to attribute correctly. Do it a few times in a loop and after ensuring the original meaning is not lost you can use it and be relatively sure that it will be difficult to identify the author of the text.

Obviously, if LLM’s are going to be used to obfuscate text then other LLM’s will be created that try to de-obfuscate the text and the systems will keep getting more and more smarter.

– Suramya

August 19, 2023

ChatGPT is not an all powerful AI it can’t even perform simple multiplications

Filed under: Artificial Intelligence — Suramya @ 9:49 PM

In my previous post I was talking about how I am usually quite skeptical of the claims being made about AI and how it is going to solve the world’s problems. There are some good usecases and there are some advantages to adding Machine Learning to the system. I have written about a few of them here.

But we are nowhere close to the Singularity and most of the folks who are pushing AI right now are the same ones who where pushing NFT’s earlier and Crypto before that… Case in point, according to founder of AI is an existential threat and OpenAI ChatGPT is a showcase of how advanced AI has become. However, this ‘advanced’ AI can’t even multiply two numbers to get the correct answer. I asked ‘What is 7467*5730’ and it gave me ‘42,777,810’. Then I asked my calculator to perform the same multiplication and that gave me: (Drum roll please…) 42,785,910. (See the screenshots below)


ChatGPT can’t perform a simple multiplication

Others have faced the same issue and I rest my case about why we need to be very careful using these AI assistants because they give answers that look legitimate and correct but are completely wrong or have subtle errors that need expertise to identify.

– Suramya

August 18, 2023

The Judge by GoblinTools is a great tool to tell how written text comes across qualitatively

Readers of this blog (and those who know me) know that I am usually quite skeptical of tools that claim to judge the emotional content of text or tell how the text comes across qualitatively. However, this new site called The Judge – Goblin Tools is quite impressive. As per James over on Mastodon, the tool was created to help neurodivergent folks communicate better with the normals avoiding misunderstanding, bad assumptions about intent, etc.

I tested it out with content from my blog and I have to say that it summarized the tone and content quite nicely. For example below is the summary it gave for my post on Celebrating India’s 76th Independence day!

Emotionally, this text comes across as proud, patriotic, and reflective. It begins by acknowledging and celebrating India’s 76th Independence Day, recognizing the significance of gaining freedom from British rule. It highlights the sacrifices, bloodshed, and tears endured by many individuals who fought for India’s freedom, emphasizing that not all their names are known and that this is a tragic aspect. The text expresses a sense of frustration with the tendency to focus solely on iconic figures like Gandhi and Nehru, disregarding the efforts of numerous other freedom fighters.

As the text looks towards the future, there is a strong emotional undertone of remembrance and gratitude towards those who paved the way for freedom. It cites famous slogans from freedom fighters, adding a sense of inspiration and reverence for their contribution. The passage acknowledges the importance of remembering the sacrifices made by past generations for the betterment of the nation.

There is a shift in emotion when it proudly proclaims India’s progress and achievements in various fields, such as technology, space exploration, and healthcare. It displays a sense of national pride and triumph over past perceptions that diminished India’s image. The text mentions India’s relief efforts during the COVID-19 pandemic and positions India as a nation capable of compassionate and humanitarian actions.

Moving forward, the text acknowledges areas that still require improvement, alluding to societal customs and mindsets. It expresses a desire for growth and change while also highlighting the need for self-reflection in other countries that criticize India, pointing out their own flaws and challenges.

The passage concludes with a message of unity and inclusivity, promoting the idea that humanity should transcend differences in caste, religion, nationality, sexuality, and age. It embraces the concept of a global family and emphasizes the values of humanity and national loyalty.

Overall, this text conveys a mixture of pride in India’s accomplishments, gratitude for the sacrifices made by freedom fighters, and a sense of reflection on the challenges that still exist. It aims to inspire unity, progress, and a commitment to the values that define the nation.

It did manage to capture the exact tone I was going for so that is quite nice. According to their About Us page, the site uses AI technologies in the backend including OpenAI’s models. They are planning to move to open source alternatives as and when they become available and reliable. Keeping that in mind, I would not recommend using this to analyze any text that has private or confidential information because it might be used to train OpenAI’s models. That being said I would be keeping an eye on this software and once they go to an opensource model and allow us to run a local instance of the tool I certainly wouldn’t mind using as part of my writing toolkit.

– Suramya

July 27, 2023

GPS Data Could potentially be used to Detect Large Earthquakes in advance

Filed under: Emerging Tech,My Thoughts — Suramya @ 10:31 PM

Earthquakes are extremely devastating and because we don’t have a way to predict them in advance they end up taking a huge toll on lives. The existing systems for earthquake prediction are fraught with false positives to the point of being useless. However, that hasn’t stopped people from trying to predict them, and in a new paper researchers Quentin Bletery and Jean-Mathieu Nocquet claim to have found a unique way to predict them up to 2 hours in advance using GPS data.

They analyzed high-rate GPS time series before 90 different earthquakes that were magnitude 7 and above to find a precursor signal and they observed a subtle signal that rose from the noise about 2 hours before these major earthquakes occurred. This looks extremely promising and if validated can change how we approach disaster management of earthquakes. However, the study still needs to be validated and we don’t yet know if the precursor signal could ever be measured for individual events with the accuracy needed to provide a useful warning.

The existence of an observable precursory phase of slip on the fault before large earthquakes has been debated for decades. Although observations preceding several large earthquakes have been proposed as possible indicators of precursory slip, these observations do not directly precede earthquakes, are not seen before most events, and are also commonly observed without being followed by earthquakes. We conducted a global search for short-term precursory slip in GPS data. We summed the displacements measured by 3026 high-rate GPS time series—projected onto the directions expected from precursory slip at the hypocenter—during 48 hours before 90 (moment magnitude ≥7) earthquakes. Our approach reveals a ≈2-hour-long exponential acceleration of slip before the ruptures, suggesting that large earthquakes start with a precursory phase of slip, which improvements in measurement precision and density could more effectively detect and possibly monitor.

This is an area where Machine Learning might prove to be useful to extrapolate and predict but that being said we still need to validate and verify before implementing it or depending on it. The paper with their findings was published in Science (DOI: 10.1126/science.adg2565)

Source: Hacker News: Early Warning: GPS Data Could Detect Large Earthquakes Hours Before They Happen

– Suramya

July 26, 2023

New Double sided solar panels nearly double the power production per panel

Filed under: Emerging Tech,Science Related — Suramya @ 11:12 PM

Solar Panels have come a long way in the last few decades and their efficiency has been consistently increasing over the time as well. We have gone from an efficiency of ~10% on an average to more than 25% today. Now researchers from US Department of Energy’s National Renewable Energy Laboratory (NREL) have created a new double sided solar panel that generates electricity from both sides of the panel. Basically it uses reflected light on the back side of the panel to generate power. Even though the amount of power generated by the backside of the panel is only ~90% of the power generated by the front end adding them both together means that a single panel is generating almost double the power than traditional panels.

Bifacial photovoltaics (PV) harvest solar irradiance from both their front and rear surfaces, boosting energy conversion efficiency to maximize their electrical power production. For single-junction perovskite solar cells (PSCs), the performance of bifacial configurations is still far behind that of their state-of-the-art monofacial counterparts. Here, we report on highly efficient, bifacial, single-junction PSCs based on the p-i-n (or inverted) architecture. We used optical and electrical modeling to design a transparent conducting rear electrode for bifacial PSCs to enable optimized efficiency under a variety of albedo illumination conditions. The bifaciality of the PSCs was about 91%–93%. Under concurrent bifacial measurement conditions, we obtained equivalent, stabilized bifacial power output densities of 26.9, 28.5, and 30.1 mW/cm2 under albedos of 0.2, 0.3, and 0.5, respectively. We further showed that bifacial perovskite PV technology has the potential to outperform its monofacial counterparts with higher energy yields and lower levelized cost of energy (LCOE).

This is a significant breakthrough and the research was published in the journal Joule titled “Highly efficient bifacial single-junction perovskite solar cells”.

I love the fact that renewable energy is getting so much more push nowadays. I have been exploring putting solar at my place, but since I am in an apartment I don’t have much options available that would make financial sense. The panels I could put up would barely supply enough power making the whole thing not cost effective. Parents have put solar at our house in Delhi and my cousin has done the same at their farm where most of their power consumption is managed by their solar setup.

– Suramya

June 28, 2023

Please stop shoving ChatGPT Integration into products that don’t need it

I am getting really tired of folks shoving ChatGPT integration into everything whether it makes sense or not. The latest silliness is an electric bike with ChatGPT integration. I understand the desire to integrate GPS/Maps etc in a bike, although personally I would rather use an independent device which would get updates more frequently than the built in GPS where the maps might get updated a few times a year. Unless the maps are getting downloaded live using 3G/4G/whatever. I even understand the desire to integrate voice recognition in the setup so that the user can talk to it. But why on earth do I want/need to have ChatGPT shoved in there?

Based on ChatGPT’s well known tendency to hallucinate there is a good probability that it might decide that you should take a path that is not safe or even dump you into the ocean because it hallucinated that it was the way to go. This is the same thing we saw with Blockchain a few years ago, everything was suddenly on the Blockchain whether it needed to be or not. The sad part is that these folks are going to make a ton of money because of the hype behind ChatGPT and then bail leaving the consumers with a sub-par bike that hallucinates.

Source: Urtopia Unveils the World’s First Smart E-Bike with ChatGPT Integration at EUROBIKE 2023

– Suramya

June 9, 2023

Sound based Quantum Computers are now closer to reality due to breakthrough research

We all know about the ongoing efforts to build a Quantum Computer by encoding information into quantum states of particles of light (photons), however there is a parallel effort ongoing that is trying to build Quantum Computers that are based on Sound instead of light. This effort being led by Andrew Cleland at the University of Chicago, just had a major breakthrough and created a device that is a key component in building a sound based Quantum Computer.

Phonons are the fundamental quantum vibrations within materials, with individual phonons representing the collective motion of many trillions of atoms. The team built a chip that allows them to create single phonons on demand which are about a million times higher pitched than audible sound. They then passed it into a beam splitter which consists of 16 tiny, parallel aluminium strips designed so that any sound that hits them gets reflected and transmitted in equal parts. At supercooled temperatures they found that the Phonon entered a quantum superposition state where the whole particle was simultaneously in the state of being reflected and transmitted.

Cleland says that this is exactly what they hoped would happen because this process is a necessary step for running calculations on quantum computers that rely on particles of light. To make their chip even more like a sound-based quantum computer, the researchers also successfully recreated the way two particles of light are commonly made to “talk to each other” and how their behaviour is controlled during light-based computations.

Here, they simultaneously sent two phonons from opposite directions into the beam splitter and saw their respective superposition states influence each other. In the future, they will use this procedure to implement simple operations that make up computer programs.

Dirk Bouwmeester at the University of California, Santa Barbara, says that for particles of light, procedures like quantum teleportation or creating entanglement hinge on using beam splitters, and now they could be done with particles of sound as well. “It is truly spectacular that the team could replace photons with phonons,” he says.

There are a lot of interesting applications for this technology once it matures, for example it could be used to connect computer components that are hard to connect to each other. Using sound as the carrier instead of light opens up more possibilities. Their research has been published in the Science Journal (DOI: 10.1126/science.adg8715)

Source: NewScientist: Sound-based quantum computers could be built using chip-sized device

– Suramya

June 7, 2023

Proof of Concept setup demoing technology to beam solar power down to Earth successfully demoed

Filed under: Astronomy / Space,Emerging Tech,Science Related — Suramya @ 4:20 PM

The ability to beam power from space to earth has long been a staple of Science Fiction books and movies. On the surface it makes sense, space is huge and if we can setup solar panels in space to collect energy and get it to earth in a usable format then it is a win-win. No more having to deal with fossil fuels/nuclear reactors etc. Folks have been working on this for over 5 decades now and progress was slow as most people focused their efforts on other options such as improving land based solar panels, geothermal etc etc.

Now researchers from California Institute of Technology (Caltech) have successfully demonstrated MAPLE (Microwave Array for Power-transfer Low-orbit Experiment) which is an array of 32 flat antennas packed onto a surface slightly larger than a dinner plate. During the experiment the energy was transmitted to earth and successfully received by a receiver on the roof of the Gordon and Betty Moore Laboratory of Engineering and they were able to successfully target receivers about a foot away alternatively and transmit ~200 milliwatts of power to the receiver that powered a LED light.

Using constructive and destructive interference between individual transmitters, a bank of power transmitters is able to shift the focus and direction of the energy it beams out—without any moving parts. The transmitter array uses precise timing-control elements to dynamically focus the power selectively on the desired location using the coherent addition of electromagnetic waves. This enables the majority of the energy to be transmitted to the desired location and nowhere else.

MAPLE features two separate receiver arrays located about a foot away from the transmitter to receive the energy, convert it to direct current (DC) electricity, and use it to light up a pair of LEDs to demonstrate the full sequence of wireless energy transmission at a distance in space. MAPLE tested this in space by lighting up each LED individually and shifting back and forth between them. The experiment is not sealed, so it is subject to the harsh environment of space, including the wide temperature swings and solar radiation that will be faced one day by large-scale SSPP units.
..
..
MAPLE also includes a small window through which the array can beam the energy. This transmitted energy was detected by a receiver on the roof of the Gordon and Betty Moore Laboratory of Engineering on Caltech’s campus in Pasadena. The received signal appeared at the expected time and frequency, and had the right frequency shift as predicted based on its travel from orbit.

This is a big step forward, but I still have major doubts about the feasibility of the project, at least in the current form. Here we are using microwaves to transmit the energy from space to earth, at the level of power we need to transmit the microwave beam will cook anything that crosses it, for example if a plane flies through the beam you can say goodbye to the passengers. Even if we decide that we will establish a no-fly zone around the area what is to stop birds etc from flying into the beam and getting fried. Another problem is that microwave beams generate heat as a side-effect and that can cause a major heating of the atmosphere and change the air-currents which can cause a massive environmental impact.

We also need to consider that in order to collect the solar energy at a scale where it would be useful and make financial sense we would need to setup massive solar-panels in space. This will case a huge problem for astronomers. We already have issues being caused by the Starlink Satellites, this will be the same but at a much larger scale.

However, that being said I see the potential and if we can ever get quantum entanglement or spooky action at a distance as Einstein called it working reliably and consistently then that could potentially be used to transmit the power to earth without frying everyone in the path.

Lets see what else the researchers come up with…

Source: Caltech.edu: In a First, Caltech’s Space Solar Power Demonstrator Wirelessly Transmits Power in Space
Science.org: Satellite beams solar power down to Earth, in first-of-a-kind demonstration

– Suramya

May 16, 2023

Using AI powered chatbots to answer questions about a book series

One of the things that I have been wanting for a while is the ability to look up stuff about a book or series so that when a new book in the series comes out I don’t have to re-read the old books before starting the new one. I end up doing that because otherwise since I have forgotten a large part of the backstory it would make the new book a lot less enjoyable. There are some authors who solve this problem by summarizing the backstory when the book starts and it is really useful. When ChatGPT and associated AI bots started picking up one of the ideas I came up with was to create a chatbot trained on a book series so that I can ask it a question about the book and get an answer. Would be really useful when dealing with book series with a large cast and multiple overlying stories.

Recently privateGPT showed up in my feed with the following claim: “Ask questions to your documents without an internet connection, using the power of LLMs. 100% private, no data leaves your execution environment at any point. You can ingest documents and ask questions without an internet connection!” and it seemed like it was the perfect tool for what I wanted to do so I downloaded the program from GitHub and set it up on my machine.

Once the software was installed, I copied a single book from the Mercedes Lackey Valdemar series called Darian’s Tale 01: Owlflight into a temp directory and told privateGPT to ingest the contents. The ingestion took hours even though the file was only ~600kb in size, I left it running overnight and it completed sometime during the night. Then I ran the prompt to be able to query the chatbot. The first few times I tried querying it, the app crashed because I ran out of memory. So I enabled SWAP on my system and then it finally ran the query and answered.

Unfortunately the answers I got were complete nonsense. You can see the questions I asked and the answers I got below:

Enter a query: what is a heartstone

llama_print_timings:        load time =   974.93 ms
llama_print_timings:      sample time =     0.00 ms /     1 runs   (    0.00 ms per run)
llama_print_timings: prompt eval time =   974.77 ms /     7 tokens (  139.25 ms per token)
llama_print_timings:        eval time =     0.00 ms /     1 runs   (    0.00 ms per run)
llama_print_timings:       total time =   977.55 ms

A heartstone is a type of music that is typically composed in the key of F major. It is characterized by a steady rhythm and a melody that is often slow and mournful. 
Heartstones are often used in classical music and are often associated with love and loss. They are also used in some contemporary music genres, such as folk and world music.

The correct answer is (as per Valdemar Fandom Wiki):

A Heartstone is both an artificial node produced by the Tayledras and the node’s physical anchor. The knowledge of how to create a Heartstone was given to the Tayledras by the Star-Eyed after the Sundering of the Clans. She tasked the Tayledras to cleanse the untamed magic caused by the Mage Wars. A Heartstone is used as a vessel to contain the cleansed magic. Ley-Lines are re-routed by Adepts and Masters to drain entirely into the Heartstone, bringing the surrounding area back to normal. Once their work is finished at that location, the Clan will establish a new Vale and Heartstone in a new area that needs cleansing. They drain the old Heartstone entirely and transfer the energy to the new Heartstone where they will begin their work anew.

So I asked another question:

Enter a query: who are the Hertasi

llama_print_timings:        load time =   974.93 ms
llama_print_timings:      sample time =     0.00 ms /     1 runs   (    0.00 ms per run)
llama_print_timings: prompt eval time = 26948.27 ms /     7 tokens ( 3849.75 ms per token)
llama_print_timings:        eval time =     0.00 ms /     1 runs   (    0.00 ms per run)
llama_print_timings:       total time = 26976.13 ms

The Herta si are a type of ghostly beings in the world of Eri. They are often associated with love and romance, and they are known for their ability to control and manipulate emotions. 
They are often depicted as beautiful, ethereal creatures, with long, flowing hair and eyes that glow with an otherworldly light. 

In this result it is talking about characters from a completely different series called the Herta. The correct answer is:

Hertasi are popularly considered to be one of the five non-human sentient races created by Urtho, but the work to “uplift” the hertasi was begun earlier, by Sorcerer-Adept Khal Herta. When he died, his work passed to Urtho.

The wild hertasi began as large, solitary lizards living in swamps, with the intelligence of a dog. They were “mild-tempered reptiles, available in large quantities, living fairly simple lives.”[1] They could have been described as semi-sentient before the Adepts took a hand. After Khal Herta’s efforts, Hertasi “had simple structures, organized hunting and fishing, and rudimentary medicine.”[1] Today, they are extremely active, intelligent, cave and tunnel-dwelling, social creatures.

Since the results were completely useless like all the other AI chatbots that I have tried so far, I have removed the software on my machine and will come back to this at somepoint later in time by when things would have hopefully improved.

– Suramya

« Newer PostsOlder Posts »

Powered by WordPress