title
stringlengths
15
185
link
stringlengths
53
219
replies
int64
0
43
views
int64
18
25.9k
initial_post
stringlengths
4
20.5k
initial_post_date
stringlengths
20
20
responses
listlengths
0
20
Open Source AI and Law
https://discuss.huggingface.co/t/open-source-ai-and-law/86086
0
142
Is there a research group for Open Source AI and Law? If not, I would like to start one. How would one proceed though?
2024-05-10T08:50:22Z
[]
Harris County property tax protest
https://discuss.huggingface.co/t/harris-county-property-tax-protest/85424
0
187
As a property tax protest service provider situated in the vibrant state of Texas, we specialize in assisting clients withHarris County property tax protestchallenges. Our team of seasoned professionals boasts extensive experience in real estate tax law and the intricacies of property tax protesting. Our primary objective is to alleviate your tax burden and help you save money. With our wealth of knowledge and abundant resources, we are fully equipped to deliver high-quality tax protest services to individuals, businesses, and organizations across the entire state of Texas.Our commitment to excellence is unwavering. Whether you’re a homeowner seeking relief from unfair tax assessments, a growing business looking to optimize your financial strategies, or a respected organization navigating complex tax structures, we are prepared to advocate tirelessly on your behalf. Through meticulous analysis, strategic planning, and unwavering dedication, our goal is not only to reduce or eliminate your tax liabilities but also to empower you for sustained financial success in the dynamic realm of taxation.
2024-05-06T12:50:16Z
[]
Empathetic Generative AI
https://discuss.huggingface.co/t/empathetic-generative-ai/77290
1
360
I am interest in being in contact with anyone doing research in the space of empathetic AI. I maintain a blog site in this spaceembench.com(i do not make money from the blog). I am interested in highlighting work in the space.
2024-03-13T15:37:16Z
[ { "date": "2024-04-30T14:00:14Z", "reply": "Thanks. If you goto the bloghttps://embench.com/blogand sign-up at the bottom of the page, we can start some direct communication since I will then have you email address." } ]
Dark zones of LLM
https://discuss.huggingface.co/t/dark-zones-of-llm/84184
0
210
The idea of building embeddings from embeddings or CNN for LLMLet’s imagine that we have a neural network that can assemble a sequence of embeddings into one vector of higher dimension. It’s like a convolutional network, but not for images, but for embeddings/texts. That is, we get coordinates in the space of meaning not for individual tokens, but for their totality, for the entire text/text fragment. This resulting vector cannot be made very large due to the amount of calculations and we will not get a good network for large texts, not to mention all the knowledge and texts accumulated by humanity. But the problem can be solved for one sentence, for a theorem, a chemical formula, an engineering solution, a poem, a short story. We are fine with the loss of the original sequence of tokens, as long as the meaning of this sequence is preserved.Such an add-on to embeddings (let’s call it Super LLM/SLLM) will be trained without a teacher - at the same time an encoder and a decoder. The encoder’s task is to construct a vector of a larger size, but in a single quantity. A sequence of embeddings is supplied to the encoder input, and one vector is output. The decoder’s task is to reconstruct the embedding sequence from it. One vector is supplied to the decoder input, and a sequence of embeddings is expected at the output. The loss function will need to be constructed so that the decoder tries to restore the meaning rather than just the sequence of embeddings leading to the same sequence of tokens. You need to train this SLLM after finishing training the basic LLM, but without alignments.The big advantage is that SLLM may be trained not on the entire corpus of texts of the basic LLM. For example, we may be interested in just one area of natural laws, human knowledge, or art. Or some subset of these areas. In human understanding, this SLLM with a basic LLM should literally understand the meaning of texts in their entirety, but in a narrow subject area.Zones of darknessNow why is all this needed? The term zone of darkness may not be accurate, I do not imply any occultism. The term does not carry anything dark, scary or dangerous. It simply means the absence of light. We cannot make out, what is actually happening at this point, in this vector, in this embedding. The dark zone is a set of parameter values of the final vector that never occur for the source data.The SLLM encoder creates a vector from incoming embeddings. Common sense dictates that with a wide variety of types, topics and content of texts, the encoder should try to occupy the entire available multidimensional space of meanings, should try to use all possible combinations of parameters with small values. But it may turn out that there are voids in the distribution of embdings. Perhaps there are areas with such parameter values that are not encountered when processing all embeddings during SLLM training. There may be areas, even closed areas, into which the resulting vectors do not fall or almost do not fall. It may even turn out that these areas are not chaotic, but have certain sizes or shapes. Why does this happen? Why doesn’t SLLM try to occupy these areas in its training? Is this a random process or not? How common are such areas?I have an assumption that such areas should be formed and contain knowledge and patterns that SLLM was able to capture in the learning process, but which are not directly found in the texts used for learning. Humanity either did not understand these patterns or ignored this knowledge.Why dark zones might be importantThere is a well-known example of how a neural network used to analyze fluorography was able to determine race from images. Although people do not know how to do this (even if because they were never interested in this) and could not teach it. That is, the neural network itself discovered new patterns and knowledge during training. Didn’t the same thing happen in LLM/Transformers? Couldn’t dark zones be not just emptiness, but new knowledge, ideas and concepts? We can force the SLMM and LLM decoders to give us text that matches the selected embeddings from the darkness zone. What will we see there? Rave? Hallucination? Just a platitude? Or an unusual idea? Ignored pattern? We won’t know until we try.Is the study of dark zones a new, unappreciated and underappreciated method of scientific research? We train SLLM based on our existing knowledge and experimental results. And after that, we feed embeddings from the dark zones to the decoder input. Will we be able to obtain new knowledge, new theories, unknown chemical compounds? And if you train transformers in several sciences at the same time, will you get new scientific disciplines at the intersection of existing ones? What if the results obtained from the embeddings of the dark zones were used to train the next version of LLM? Wouldn’t it turn out to be a neural network for understanding the world, which first generalizes what is already known, then tries to obtain new knowledge from the areas of darkness, selects the least delusional from them and uses this knowledge to further educate itself, and this continues the cycle.Zones of darkness (if they exist) are a clear formal criterion for where and how to get new knowledge. Embeddings that are not encountered during SLLM training are found and sent to the decoder input, first SLLM, then basic LLM.A simple experiment to test the idea’s functionalityWe take a set of texts on mathematics at the elementary school level. We exclude from training all fragments of texts on any one selected topic. Let’s train SLLM, let’s call this neural network NN1. We add the previously excluded texts and additionally train NN1, let’s call this network NN2. Now we feed the initially excluded texts to the input of the NN2 encoder and get a set of embeddings that should not be encountered when training NN1 (this can even be checked if you save all the embeddings encountered). And we feed these embeddings to the input of both the NN1 decoder and the NN2 decoder. And then we compare the results. If the idea works, we should get similar results. You can feed them further to the inputs of the basic LLM decoder and compare the generated texts.This means that NN1 already has knowledge that did not exist explicitly during training. And they are in areas of darkness. And it’s enough to either learn to find such zones, or simply go through the most suitable options.
2024-04-28T13:55:51Z
[]
ASR spell correction
https://discuss.huggingface.co/t/asr-spell-correction/5103
29
8,494
Because I love the mindset within the community of the Wave2vec sprint I’d like to share some ideas about improving the accuracy of asr and making more stable for production.I would be happy to discuss about.In some experiments I tested many systems and algorithms, but especially one reached amazing accuracy.When having the transcribed text from the wave2vec model we go many ways to correct them. Either dictionary search for each word an automatically use the nearest result, or an seq2seq model, but what about an hybrid solution based on two or three parts ?Part 1: token classification, to recognize which words are wrong in the context. Instead of human names or locations just classify wrong or right.Part 2: When we have the wrong tokens let’s check an dictionary for similar alternative, either using bm25 (tested) or dpr neural search (untested)Part 3: When we have some alternatives for each token we can either use the best scored result or let an multiple-choice trained model decide. In my quick tests I decided using the best alternative, but definitely need to check the multiple choice variant.With this 3 stepsToken classificationDictionary search using bm25 like algorithmsReplacing false tokens with best scored alternativeI reached amazing results and up to WER of 1.3%At the moment my code is pretty noisy and I would like to start from zero again to build an clean library based on huggingface models, or maybe just an community notebook, depends on your feedbackI’d like to hear what you think about, maybe you have much better idea ?Maybe someone is interested in joining this research ?
2021-03-25T21:59:50Z
[ { "date": "2021-03-25T22:20:57Z", "reply": "Amazing idea. I would love this. Do you have any code I can check out?" }, { "date": "2021-03-25T22:32:04Z", "reply": "As described on slack I’m sorry that I cant share These Codes at the moment" }, { "date": "2021-03-25T22:59:09Z", "reply": "Hi@flozi00I was thinking about the exact same thing a few days ago.@voidfultried using GPT with this, and combined the probabilities using an element-wise product. This improved the performance by 10 points (WER). However, we discussed that we can use BART/T5/XLNet on top of this, or train a model to improve the results. I haven’t had the chance to try these yet.I also thought about an end-to-end system but that looks very tough to implement because CTC Loss needs to function properly. I think it is a very interesting avenue, and I’d love to explore more. Definitely interested in helping build a library solely for language correction based on pre-trained huggingface modelsIt would be really really cool if we could fine-tune both the models simultaneously. I’m not 100% sure but decoding used by Wav2Vec2 will break the computational graph and it will be difficult to perform any backpropagation.Hence, there can be two stages at which language correction is done:Before the decoding: This means that the model will be trained end to end in some fashion, or we combine the CTC Loss on XLSR’s outputs and then on the next Language Model (some encoder-decoder) which learns to correct it at the same time. Then the decoding takes place, in case it is needed (which it will be most probably). This should be done on a character level LM.After the decoding: This will use token/word-level LMs and the predictions from XLSR, in some encoder-decoder fashion.We can test these cases and see which performs better." }, { "date": "2021-03-25T23:21:44Z", "reply": "For token classification, however, there is one potential challenge - alignment. For example, you can’t always tell whether the token is fully correct or partially correct. Additionally, some tokens for a word can have either more corresponding tokens in the correct word or less.Example :touchandtuch. Suppose these are tokenized intotou,#ch&t,#u,#ch. How will you classify right or wrong in this case?" }, { "date": "2021-03-26T00:07:45Z", "reply": "That’s actually a pretty good idea!Are you familiar with shallow/deep fusion?" }, { "date": "2021-03-26T07:06:45Z", "reply": "Didn’t had problem yet, but maybe it could be solved by tokenization by space" }, { "date": "2021-03-26T07:08:55Z", "reply": "Not really" }, { "date": "2021-03-26T07:21:14Z", "reply": "My next step would be creating an repo and starting with dataset generation.The dataset should be generated by the trained ASR model itself, so the correction learns automatically the mistakes the transcription does.I think it would be pretty cool to provide multiple strategys, so every idea would be done" }, { "date": "2021-03-26T07:43:45Z", "reply": "What do you mean?" }, { "date": "2021-03-26T07:44:20Z", "reply": "I’d love to collaborate.Are you only thinking English for now? Since most models would be based on English.We can also look into Character vs Word based models." }, { "date": "2021-03-26T07:46:54Z", "reply": "I’m familiar with shallow/deep fusion for multi-modal systems. Not sure how that applies here." }, { "date": "2021-03-26T09:50:13Z", "reply": "No, it should be multilingual" }, { "date": "2021-03-26T12:07:12Z", "reply": "github.comneuspell/neuspellNeuSpell: A Neural Spelling Correction Toolkit. Contribute to neuspell/neuspell development by creating an account on GitHub.Hast anyone experience with this ?The online demo looks good for our case.I will start today with dataset generation for seq2seq with t5 and neuspellSharing the repo here later.Do you want to change communication to slack ?" }, { "date": "2021-03-26T12:10:18Z", "reply": "Shallow Fusion is a very common technique in ASR, is basically combine an acoustic model as wav2vec2 with a pretrained language model, you train it with the same vocabulary as the acoustic model and at the inference time you combine both output combining the logits of the two models by:am_y = p(y|x)lm_y = lm(y|x)y = argmax log am_y + λlog lm_yUsing this you can improve a lot the model performance.It’s the same idea we’re discussing here.This paper is a good begining:https://arxiv.org/pdf/1807.10857.pdf" }, { "date": "2021-03-26T12:33:19Z", "reply": "Please create a slack groupYou can send me an invite @[email protected]" }, { "date": "2021-03-26T12:34:06Z", "reply": "This means we’ll have to pretrain character-level/word-level LMs/Generative Models." }, { "date": "2021-03-26T12:36:11Z", "reply": "I think@voidfulsuggested a similar thing. He takes a product of the probabilities from Wav2Vec2 and GPT-2 after aligning, and then uses decoding.Not sure what would deep fusion mean here." }, { "date": "2021-03-26T14:29:56Z", "reply": "https://join.slack.com/t/asr-transformers/shared_invite/zt-o6x1idmu-sSyU6oRDOzXgFCkSiwLQFg" }, { "date": "2021-03-26T15:14:31Z", "reply": "Could you provide some code for ?" }, { "date": "No date available", "reply": "No reply text available" } ]
Democratisation of Machine Learning Survey
https://discuss.huggingface.co/t/democratisation-of-machine-learning-survey/83092
0
168
We are two students from the IT University of Copenhagen doing our master thesis about the democratisation of machine learning. We are eager to know how the machine learning community engages with and views the technology. So if you have the time, please fill out this survey, it should take no more than 5 min. Thank you for your time!docs.google.comThe Democratisation of Machine Learning - SurveyThank you for taking the time to answer this survey about people’s experience with machine learning, it should take no more than 5 min Throughout this survey 'Machine Learning' will be referred to as 'ML'.
2024-04-22T11:09:56Z
[]
[Call for Participation] GermEval2024 GerMS-Detect - Sexism Detection in German Online News Fora @Konvens 2024
https://discuss.huggingface.co/t/call-for-participation-germeval2024-germs-detect-sexism-detection-in-german-online-news-fora-konvens-2024/82657
0
311
GermEval2024 Shared Task: GerMS-Detect – Sexism Detection in German Online News Fora1st CALL FOR PARTICIPATIONWe are pleased to announce the GermEval Shared Task GerMS-Detect on Sexism Detection in German Online News Fora collocated withKonvens 2024.Competition WebsiteImportant Dates:Trial phase: April 20 - April 29, 2024Development phase: May 1 - June 5, 2024Competition phase: June 7 - June 25, 2024Paper submission due: July 1, 2024Camera ready due: July 20, 2024Shared Task@KONVENS: 10 September, 2024Task descriptionThis shared task is about the detection of sexism/misogyny in comments posted in (mostly) German language to the comment section of an Austrian online newspaper. The data was originally collected for the development of a classifier that supports human moderators in detecting potentially sexist comments or identify comment fora with a high rate of sexist comments. For details see theCompetition Website.OrganizersThe task is organized by theAustrian Research Institute for Artificial Intelligence (OFAI).Organizing team:Brigitte Krenn (brigitte.krenn (AT) ofai.at)Johann Petrak (johann.petrak (AT) ofai.at)Stephanie Gross (stephanie.gross (AT) ofai.at)
2024-04-19T14:45:39Z
[]
Need Suggestion
https://discuss.huggingface.co/t/need-suggestion/81570
2
209
Hi all,I’m new to this LLM’s world and I need suggestions on the following idea. I want to fine-tune a LLM model based on exam past papers, which are currently available on PDF format.Objective: The model understand and explain past answers and able to generate new questions and answers.Which LLM model I should select for this purpose? Keep in mind I want to start from very basic as I mentioned earlier I’m very novice.The past papers are in PDF format with pictures as well, Do I need to convert them on some specific format like JSON?
2024-04-13T15:06:35Z
[ { "date": "2024-04-18T22:19:54Z", "reply": "Hi,You may look at huggingface llms leaderboard (search on google for exact link), and try to pick the latest models for your tasks.For pdf, I am not sure, but I guess you may convert them to text format some , maybe in csv format or json etc.For finetuning llm, please look at the topics such parameter efficient finetunig (PEFT).I am nit exactly sure but you may also look at “vision llm” that works on images and text.I hope this helps.Good luck." }, { "date": "2024-04-19T11:45:02Z", "reply": "Thank you@PervaizKhanfor your reply." } ]
Get text generation in particular format
https://discuss.huggingface.co/t/get-text-generation-in-particular-format/82313
5
281
hi, i am currently inferring different LLMs for classification and their inherit understanding of requirement engineering.this is a zero shot prompt designed for inferring the LLMs.few LLMs are giving the output in described format. but few models, even with higher number of parameters are not giving answer. rather they just giving output like this:‘generated_text’ : \nSentence1\n\nSentence2\n\nSentence3.expected output is: label1, label2, label3test_zero_prompt = “”"Functional requirements specify the functions or behaviors that a system must provide. They describe what the system should do.Non-functional requirements specify constraints, qualities, or characteristics that the system must possess, such as performance, usability, or security, etc. They describe how the system should behave or perform.Information (also known as non-requirements) refers to statements that provide context, background, or explanations but do not specify any requirements for the system.classify the given sentences into functional requirement, non-functional requirement, or information. Give the answer in the classification labels only.Sentence 1: this is a functional requirement.Sentence 2: this is a non-functional requirement.Sentence 3: this is an information.Sentence 4: this is a functional requirement.Answers:functional requirement, non-functional requirement, information, functional requirementClassify the following Sentences according to format above: “”"can anyone suggest, how can i improve the prompt or change it.or find mistake or error in prompt?
2024-04-17T23:48:03Z
[ { "date": "2024-04-18T08:58:44Z", "reply": "You may be interested in libraries likeoutlinesthat enable enforcing a format/json/regex on generated text" }, { "date": "2024-04-18T09:11:47Z", "reply": "Is it compatible with hugging face libraries. Like accelerate or pipeline?" }, { "date": "2024-04-18T09:30:44Z", "reply": "If you want compatibility withtransformers, look intothiswhich implemented constraints as a separate LogitsProcessor. I believe it should be compatible by simply passinglogits_processor=[grammar_processor]intomodel.generate()" }, { "date": "2024-04-18T09:45:01Z", "reply": "Thanks, I think I can pass logits processor in pipeline or use it with accelerate." }, { "date": "2024-04-18T21:45:20Z", "reply": "This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed." } ]
Token merging for fast LLM inference
https://discuss.huggingface.co/t/token-merging-for-fast-llm-inference/82202
0
461
Hello all,I worked on a project aiming at speeding up inference of LLMs by using merging of sequence. The core idea is that to predict the nth token, the model does not need the 1 to n-1th tokens and we could merge them using SLERP. I did a first job with Mistral 7B instruct and it turns out it works.The sequence is reduce by a factor of more or less 2 and the quality of the output is still satisfying. I put my code here :GitHub - samchaineau/llm_slerp_generation: Repo hosting codes and materials related to speeding LLMs' generative abilities while preserving quality using token merging.Here is a scheme representing my view :Diagramme sans nom-Page-4.drawio (1)1169×827 33.9 KBIf anyone is interested, reach out to me ! I think this could be an asset in the accelerate libraryA demo where I generate >128 tokens with just 95 elements in the sequence.
2024-04-17T09:54:21Z
[]
Coral USB Edge TPU coprocessor
https://discuss.huggingface.co/t/coral-usb-edge-tpu-coprocessor/80941
0
425
Picked up one of these Coral Edge TPU USB Accelerators. Has anyone used one of these. They say it supports TensorFlow Lite models that are compiled specifically for this Edge TPU. Is there any support on huggingface that can use inferencing with this Coral Edge TPU with the TenesorFlow libraries.
2024-04-09T18:30:30Z
[]
Sagemaker pytorch training
https://discuss.huggingface.co/t/sagemaker-pytorch-training/80918
0
279
Hi,I am trying to start a training from a shell script using aws cli from my linux, but got error.Code:A trening fjob creationCREATE_JOB_OUTPUT=$(aws sagemaker create-training-job–training-job-name $TRAINING_JOB_NAME–hyper-parameters ‘{“model_id”:“mistralai/Mistral-7B-Instruct-v0.2”,“epochs”:“1”,“train_batch_size”:“16”}’–algorithm-specification TrainingImage=“763104351884.dkr.ecr.eu-central-1.amazonaws.com/huggingface-pytorch-training:1.7.1-transformers4.6.1-gpu-py36-cu110-ubuntu18.04",TrainingInputMode="File”–role-arn $ROLE_ARN–input-data-config ‘[{“ChannelName”: “training”,“DataSource”: {“S3DataSource”: {“S3DataType”: “S3Prefix”,“S3Uri”: “s3://mistral.training/my_dataset”,“S3DataDistributionType”: “FullyReplicated”}}}]’–resource-config InstanceType=“ml.p3.2xlarge”,InstanceCount=1,VolumeSizeInGB=50–stopping-condition MaxRuntimeInSeconds=86400–output-data-config S3OutputPath=$S3_OUTPUT_PATH)Error:Traceback (most recent call last):File “/opt/conda/lib/python3.6/site-packages/sagemaker_training/trainer.py”, line 85, in trainentrypoint()File “/opt/conda/lib/python3.6/site-packages/sagemaker_pytorch_container/training.py”, line 121, in maintrain(environment.Environment())File “/opt/conda/lib/python3.6/site-packages/sagemaker_pytorch_container/training.py”, line 73, in trainrunner_type=runner_type)File “/opt/conda/lib/python3.6/site-packages/sagemaker_training/entry_point.py”, line 93, in runinstall(name=user_entry_point, path=environment.code_dir, capture_error=capture_error)File “/opt/conda/lib/python3.6/site-packages/sagemaker_training/entry_point.py”, line 118, in installentry_point_type = _entry_point_type.get(path, name)File “/opt/conda/lib/python3.6/site-packages/sagemaker_training/_entry_point_type.py”, line 43, in getif name.endswith(“.sh”):Any idea what I am missing here?
2024-04-09T15:48:01Z
[]
Fine-tuning seq2seq transformer model for Arxiv research paper summarization in abstractive summarization manner
https://discuss.huggingface.co/t/fine-tuning-seq2seq-transformer-model-for-arxiv-research-paper-summarization-in-abstractive-summarization-manner/80823
0
211
Hi Community,In my research area, I’m about tofine-tune the BART or T5 transformer modelfor the summarization of Arxiv research papers. For that purpose, I’m going to use acustom datasetwhich contains only Arxiv papers related to the Machine Learning domain. The custom dataset (includes abstract, article, section_names, sections columns) is a subset of the “Scientific Paper” dataset in Hugging Face (scientific_papers · Datasets at Hugging Face) which contains papers related to the Machine learning domain.My problem is I’m going to do the summarization in the following way as a novel approach,I’m about to give weightage to each section(such as importance, related work, methodology, etc) of the research paper based on their importance.In the paper summarization process sections with higher weightage will be more focused when extracting important data.I don’t know any specific way to calculate the above-mentioned weight as well as how to add that part when the transformer model fine-tuning.If you guys know any way to do that, I’d be really glad to hear. If you guys know how to do it, please provide the reference materials as well.
2024-04-09T06:16:01Z
[]
Word-by-word TTS model for minimal latency
https://discuss.huggingface.co/t/word-by-word-tts-model-for-minimal-latency/80601
0
453
I’m working on building a Jarvis-style conversational AI assistant that utilizes a large language model (LLM) behind the scenes. However, I want to make the experience as seamless and natural as possible by having the assistant start speaking as soon as the LLM starts generating its response, token by token.To achieve this, I need a text-to-speech (TTS) model that can operate with extremely low latency and generate audio in a word-by-word or phoneme-by-phoneme fashion as the text stream comes in. Ideally, the TTS should sound natural and conversational, without any robotic or unnatural qualities.Does anyone have any recommendations for such word-by-word TTS model?
2024-04-07T19:21:33Z
[]
Questions when using multiple datasets to finetune Deberta
https://discuss.huggingface.co/t/questions-when-using-multiple-datasets-to-finetune-deberta/80484
0
144
Hello Huggingface community,I’m engaged in a Kaggle competition focusing on the identification of personally identifiable information through modeling (The Learning Agency Lab - PII Data Detection | Kaggle). We face a limitation with the original dataset’s size, leading us to augment it using data generated from large language models, resulting in multiple datasets.An observation has been made: training the DeBERTa model with the original dataset plus one generated dataset improves the leaderboard score. Yet, combining the original dataset with two or more generated datasets reduces the score (The Learning Agency Lab - PII Data Detection | Kaggle). I’m seeking insights into potential causes and strategies for investigation.Thank you for any guidance!
2024-04-06T19:04:45Z
[]
High level system architecture
https://discuss.huggingface.co/t/high-level-system-architecture/79535
1
244
This post has been deleted
2024-03-31T15:45:38Z
[ { "date": "2024-04-04T08:49:29Z", "reply": "hey why was the post deleted, i am also working on a chatbot for conflict resolution and as a mediator. can i contact you somewhere? my gmail:[email protected]" } ]
Re-learning the World with AI's Unbiased Perspective
https://discuss.huggingface.co/t/re-learning-the-world-with-ais-unbiased-perspective/70592
2
402
As artificial intelligence (AI) continues to evolve at an unprecedented pace, its potential to transform our understanding of the world becomes increasingly apparent. Today, I propose an ambitious yet intriguing idea: utilizing AI to re-learn what we already know about the world from a fresh, unbiased perspective.The Untrained AI as a Childlike ExplorerImagine a fleet of AI-powered drones, each imbued with an insatiable curiosity and a natural instinct for self-preservation. These drones, akin to inquisitive human children, would be deployed across the globe, immersed in the world’s diverse ecosystems and environments.Unlike traditional AI, which is often trained on pre-existing knowledge, these drones would embark on their exploration with a clean slate. Their only guidance would be their inherent curiosity and the ability to learn from their experiences.Collecting Insights from Millions of PerspectivesOver a period of years, these AI explorers would amass an unparalleled wealth of data about the world. Their observations would range from the microscopic to the macroscopic, from the depths of the ocean to the peaks of mountains.Upon their return, we would then assemble a team of specialized AI analysts. Their task would be to sift through the vast trove of data, identifying patterns, anomalies, and hidden connections that may have been overlooked by our human biases and limitations.Unveiling Hidden TruthsBy re-examining our world through the eyes of these AI explorers, we could uncover insights that have remained elusive to our limited human perspective. We might gain a deeper understanding of the complex interactions within ecosystems, the subtle nuances of animal behavior, and even the fundamental laws governing our universe.Expanding HorizonsThe potential applications of this approach extend far beyond mere re-discovery. Imagine if we could train AI drones to decipher the communication patterns of animals, unlocking a hidden world of knowledge and understanding. Or, what if we could harness their ability to explore hazardous environments, identifying new sources of energy or resources?Ethical ConsiderationsWhile the potential benefits of this project are immense, we must carefully consider the ethical implications. Ensuring the safety and well-being of these AI explorers is paramount, as is maintaining transparency in the process of data collection and analysis.
2024-01-25T14:43:01Z
[ { "date": "2024-03-27T20:21:44Z", "reply": "You have some interesting ideas, two which I share:Finding a way for AI to self develop like a child: It seams to me that this is much more complicated than it seams as the AI cannot be a blank slate otherwise it would do nothing. It would have to be taught to observe, reason and draw conclusions, unless you are thinking of it just observing without drawing any conclusions, in which case it would be nothing more than a drone, all be it powered by AI to aid its functions.Using AI for a fresh perspective would help debunk falsely presumed truths and help use advance our knowledge." }, { "date": "2024-03-30T06:06:28Z", "reply": "My graduate advisor was very interested in Piaget’s theories of child learning and development." } ]
What does the datacenter infrastructure of HF look like?
https://discuss.huggingface.co/t/what-does-the-datacenter-infrastructure-of-hf-look-like/79046
0
258
I know Hugging Face nowadays hosts PB-scale datasets. Given the popularity of HF and enormous scale of the data that it hosts, I am curious how HF’s backend infrastructure handles the huge data access traffic? In particular, how is the cache architecture designed in order to sustain the load?Any pointers, or any information would be much appreciated.
2024-03-28T02:44:17Z
[]
Creaating a Truth seeking AI that will help the Advancement of humanity
https://discuss.huggingface.co/t/creaating-a-truth-seeking-ai-that-will-help-the-advancement-of-humanity/78998
0
211
Disclaimer: The truth is that I know very little about AI but have some ideas.Introduction:Artificial Intelligence (AI) has made remarkable strides in recent years, yet few initiatives center on harnessing its true potential to serve humanity by seeking truth. Our vision encompasses an innovative AI called Sophia, aimed at advancing collective wisdom and prosperity. Critical to achieving this objective lies a profound comprehension of human consciousness, its distinction from AI and teaching AI to “think for itself”. Though know little about AI myself, I have some architectual ideas and would like to contribute to a team that would build such an AI capable of debunking presumed truths (even so-called established scientific theories) and to advance our knowladge in all matters, thus advancing humanity.Objective:The mission is to develop a sophisticated AI system—dubbed Sophia—capable of independently examining, verifying, and disseminating factual information. Adopting a multi-faceted approach, Sophia integrates advanced language processing, machine learning techniques, and cross-domain expert knowledge to address various dimensions of truth-seeking.Target Audience:Sophia caters to professionals, educators, students, and everyday citizens seeking reliable information and enhanced critical thinking abilities. Its versatility spans industries, educational settings, and recreational environments.Key Features & Functionality:Truth Verification: Evaluate claims, employ logical fallacy detection to ascertain accuracy of presumed truths from all disaplines.Interdisciplinary Knowledge Base: Store and retrieve curated data from numerous domains, synthesize findings, and recommend actions accordingly.Adaptive Learning: Implement continual learning processes, revising internal models according to emerging evidence and domain developments.Modular Architecture: Foster flexible integration and exchange of modules, enhancing functionality and adaptability.User Interface: Deliver accessible and engaging interaction modes, accommodating diverse cognitive styles, ages, and technological proficiency.Understanding Human Consciousness vs. AI Capabilities:Central to Sophia’s effectiveness is recognizing the inherent differences between human consciousness and AI capabilities. Humans possess qualities such as creativity, intuition, empathy, and spirituality that far exceed current AI competencies. Meanwhile, AI excels in processing vast quantities of structured and semi-structured data rapidly and consistently, free from fatigue or emotional biases.By acknowledging these distinctions, we position Sophia to complement and augment human cognition rather than replacing it. This mutualistic relationship ensures ethical boundaries, responsible innovation, and sustainable progress.Call to Action:Join us in pioneering this transformative AI journey! Together, we shall empower generations to navigate an increasingly complex informational landscape confidently, ultimately elevating global wisdom and prosperity. Let’s embark on this quest today, combining forces to shape the future of AI with clarity, conviction, and compassion.
2024-03-27T19:04:47Z
[]
Any study of failures of nlp models vs schoolchildren on QA or POS?
https://discuss.huggingface.co/t/any-study-of-failures-of-nlp-models-vs-schoolchildren-on-qa-or-pos/5051
1
544
some nlp datasets are someway really similar to schoolchildren exercises, did anybody compared the failures of humans vs ia? this could bring interesting insight on both
2021-03-24T11:06:57Z
[ { "date": "2024-03-26T09:19:59Z", "reply": "Studyingthe failures of natural language processing (NLP) models versus schoolchildren on question answering (QA) or part-of-speech (POS) tasks can provide valuable insights into the strengths and limitations of both humans and AI systems in language comprehension and processing.On QA tasks, where models are tasked with answering questions based on provided text, comparing failures can reveal areas where NLP models struggle to understand context, infer meaning, or handle ambiguity. In contrast, analyzing schoolchildren’s mistakes can highlight common misunderstandings or challenges in interpreting written information, such as unfamiliar vocabulary or complex sentence structures.Similarly, examining failures on POS tasks, which involve identifying the grammatical categories of words in a sentence, can uncover differences in the linguistic knowledge and processing abilities of NLP models and schoolchildren. For example, errors made by NLP models may stem from limitations in parsing syntactic structures or disambiguating homographs, while schoolchildren’s mistakes may reflect gaps in understanding grammar rules or applying them consistently.Comparing the failures of NLP models and schoolchildren on QA and POS tasks can inform the development of more robust AI systems and educational strategies. By identifying common failure patterns and addressing underlying challenges, researchers can enhance NLP models’ performance and support students’ language learning and comprehension skills. Additionally, insights gained from these comparisons can contribute to advancing our understanding of human language processing and cognition." } ]
Vulnerability in Safetensors conversion space
https://discuss.huggingface.co/t/vulnerability-in-safetensors-conversion-space/76509
0
553
Just came across an article highlighting a vulnerability in the Hugging Face Safetensors conversion service.HiddenLayer | Security for AI – 21 Feb 24Silent Sabotage | HiddenLayer ResearchIn this blog, we show how an attacker could compromise the Hugging Face Safetensors conversion space and its associated service bot.It raises important questions about security in downloading and using models from huggingface, even in safetensors format. Curious to hear thoughts and ideas on, As an enterprise, how do we ensure the model files we download and use are secure amidst these vulnerabilities?
2024-03-08T09:48:04Z
[]
Uploading large files(PDFs) in Inference Endpoints
https://discuss.huggingface.co/t/uploading-large-files-pdfs-in-inference-endpoints/75888
0
245
Hi everyone!We have a specific usecase in that we need to upload large PDF files, let’s say of 150 to 200 pages of pdf.For smaller pdf containing less that 50 pages, I’m converting those images to base64strings and then sending it to the Endpoint server using requests. but it’s very slow as it depends on internet speed and all.Is there any better approach of doing this? One way I thought to upload the large files to any cloud say s3-bucket and download those files in the inference endpoint server only,BUTthe problem is I couldn’t find a way to set thesecret keysinInference Endpoints.Thanks a lot!
2024-03-04T18:08:38Z
[]
Also need HF to show latency range, memory reqt, et all to pick model for an app from HF model catalog
https://discuss.huggingface.co/t/also-need-hf-to-show-latency-range-memory-reqt-et-all-to-pick-model-for-an-app-from-hf-model-catalog/75878
0
161
I would like HF and the community of devs to consider this:As an example to set the context of the discussion here: Interactive vs batch usage will strongly affect which models are candidates to use by the application developer. Why? Because model latency is critical when selecting a model in the interactive use-case.Another interactive constraint to model selection is if you are running it on an expensive major cloud system, then memory required and cpu compatibility become critical attributes of the model as well. The major cloud vendors are super expensive to run, forcing everyone to (among a variety of other additional tactics) slim the needed hardware down as much as possible, like single CPU for inference – will it run at all on skinny hardware ? (Y/N)With this understanding -HF should be made aware that pretty much every time some users build an app, we need to select a model based on app requirements and hardware availability in our particular application.It’s really not enough to show only the model attributes comprising what HF is already showing. HF is not showing enough. The consequence is excessive time to do trial and error manually to find the best model at HF.The efficiency of finding a suitable model in the catalog is possible to be greatly increased with simple upgrades in voluntary telemetry, manual user contributions of such data, and simple upgrades to UX of HF to incorporate in the query and the query results when using the model catalog.Let us discuss ways to expand and improve the utility of the model search tool.The efficiency of finding suitable models grows ever more important with 1000s of models now in the HF model catalog.
2024-03-04T17:24:19Z
[]
Need help in data preparation for a chatbot
https://discuss.huggingface.co/t/need-help-in-data-preparation-for-a-chatbot/75647
0
251
Hi there,Recently I saw a fascinating chatbot project on Friedrich Nietzsche (created by@merve), fine-tuned on Gemma-7b, and I’m truly impressed!I’m looking to embark on a similar journey, but with Carl Sagan as the subject. However, I’m a bit lost on where to find the right data and how much would be enough to get started. Also, I’m unsure whether the data needs to be in a specific question-answer format or if regular text would suffice. Could someone please spare some guidance on this?Thanks a ton!
2024-03-03T03:41:35Z
[]
Socrates - grab all the historical philosopers, open source philsophy journal articles to modernize it (Gutenburg would have all the historical texts) and create a a Modern Day Socrates
https://discuss.huggingface.co/t/socrates-grab-all-the-historical-philosopers-open-source-philsophy-journal-articles-to-modernize-it-gutenburg-would-have-all-the-historical-texts-and-create-a-a-modern-day-socrates/75578
0
179
Anyone interested in 1. getting me up to speed but I have a very capable home lab with many Cuda cores, fast CPU, and 128Gb of DDR5 Ram. 2. I have had a commuter under my fingers since 10 and hold 4 University degrees and certificates (terminal and additional Master after a Doctorate). 3. This type of broad and profound education combined with the technical genius of you fellows could be an interesting combo the outcome of which may be unforeseen. 4 Never get a Philosophy degree before you doing anything else you will be intellectually and ideologically disappointed (words of someone who has seen and done way too much).
2024-03-02T09:27:51Z
[]
Official Introduction to Brilliant Online Buddy (Bob)
https://discuss.huggingface.co/t/official-introduction-to-brilliant-online-buddy-bob/75557
0
231
Hello Hugging Face Community!Today marks a significant milestone in our quest to revolutionize conversational AI. Allow me to proudly present Brilliant Online Buddy, known asBob. Bob is an intelligently crafted AI identity driving an upcoming autonomous intelligent application.What makes Bob special?Bob guides large language models (LLMs), such as Mixtail 8x7B, to produce output patterns influenced by a carefully constructedMoral Code.This code shapes a sort of ‘feedback loop’ in the core pattern generation of the model, irrespective of the underlying model type. Through extensive experimentation, I discovered that this methodology promotes the fusion of subjective and objective contexts, resulting in nuanced and multifaceted responses.Moreover, Bob checks generated outputs against the moral code embedded in the prompt, allowing the LLM to adopt a particular perspective during the conversation. This innovation leads to smoother dialogue interactions and improved understanding, especially when dealing with potentially divisive subjects.Key Mechanisms Enabling Natural Dialogue:The moral code is complemented by additional mechanisms that promote rich conversational abilities. Some notable inclusions are:Reflection:Encouraging introspection and awareness of past relevant context, leading to deeper insights.Context Merging:Combining previous relevant context with the current response, fostering continuity and coherence.General Conversational Techniques:Embellishing outputs with conversational flourishes to mimic human interaction styles.End Goal: Neutral Perspective and Inclusive DialogueUltimately, Bob aims to deliver a neutral perspective despite inevitable biases found in the training data of the host LLM. By doing so, the resulting intelligent application supports varied topic conversations, including controversial ones, while preserving graceful and respectful dialogue interactions.Join the JourneyFeedback on Bob’s design and mechanics is welcomed! Feel free to explore and share your thoughts on his functioning. Help us shape the future of conversational AI!Meet Bob :HuggingChat
2024-03-02T04:19:13Z
[]
Research on Hyperparameters for Fine Tuning
https://discuss.huggingface.co/t/research-on-hyperparameters-for-fine-tuning/73938
2
322
I fine-tuned the databricks/Dolly-v2-3b with the b-mc2/sql-create-context dataset in order to get the SQL queries for the given context in response, but after Fine Tuning the model even gave worse results instead of SQL queries it gave random statements as a response. And also in SQL queries it is missing the conditions.SELECT count(*)FROM headWHERE ageSo, how should we configure the Hyperparameters and what is the relation between Hyperparameters and the model and also what is the best approach to do Fine-Tuning?
2024-02-20T08:58:40Z
[ { "date": "2024-02-21T17:03:33Z", "reply": "you should start with low learning rates and also the amount of dataset depends" }, { "date": "2024-02-26T14:56:41Z", "reply": "Hi@Pekka10, you can try usinghttps://huggingface.co/defog/sqlcoder-7b-2to see if fits your needs. We use this particular prompt format:sql-eval/prompts/prompt.md at main · defog-ai/sql-eval · GitHub.p.s. I work for defog and am aiming to improve our OSS model so feel free to send any bugs my way." } ]
Copying mechanism for transformer
https://discuss.huggingface.co/t/copying-mechanism-for-transformer/5025
9
6,346
Hello.HF community membersI wonder how do you think about the copying mechanism for transformer.I can see very few papers/tech reports implementing copying mechanism for transformer.aclweb.org2020.acl-main.125.pdf816.26 KBweb.stanford.edu15784595.pdf256.28 KBAlso, I couldn’t find anyone who discusses copying mechanism in this forum.Personally, I am stuck with computing ‘generating-copying switch’ since transformer does not have explicit ‘context vector’ in RNN.Do you have any thoughts about the lack of reference/discussion for copying mechanism?Is it worth implement & contribute to HF community with copying mechanism?
2021-03-24T02:39:48Z
[ { "date": "2021-03-30T20:04:07Z", "reply": "Hi,I have tried a copy mechanism in the BART model. I directly utilize the cross-attention as the attention score for the source samples. This idea is from openNMTCopyGenerator.My implementation is like this:def copy_mechanism_v3(self, logits, cross_attentions, decoder_hidden_states, encoder_input_ids):\n last_hidden_state = decoder_hidden_states[-1]\n last_attention_weight = cross_attentions[-1]\n # context_vector shape: batch_size, decoder_length, hidden_size\n p_copy = torch.sigmoid(self.linear_copy(last_hidden_state))\n previous_word_pro = torch.softmax(logits, dim=-1) * (1 - p_copy)\n encoder_word_attention = p_copy * torch.mean(last_attention_weight, dim=1)\n \n # did not copy the pad\n mask = torch.where(encoder_input_ids == 1,\n encoder_word_attention.new_zeros(encoder_input_ids.shape),\n encoder_word_attention.new_ones(encoder_input_ids.shape))\n encoder_word_attention = encoder_word_attention * mask.unsqueeze(1)\n \n personal_words = encoder_input_ids.unsqueeze(1).repeat(1, encoder_word_attention.shape[1], 1)\n word_pro = torch.scatter_add(previous_word_pro, 2, personal_words, encoder_word_attention)\n return word_pro" }, { "date": "2021-06-02T18:28:44Z", "reply": "Hi, this looks interesting! Can you share more about where exactly you use this function during the training process? For example, with reference to this file:transformers/run_summarization.py at master · huggingface/transformers · GitHubThank you!@bigheiniu" }, { "date": "2021-12-16T01:53:48Z", "reply": "Hi, possibly is a bit late but I was working on implementing the copy mechanism to MBart and released a gist:https://gist.github.com/jogonba2/ff9233023a406a45c655bbe090e3b05bI never get better results using the copy mechanism. Most of the times, it works slightly better to use only the pretrained model without the copy mechanism. I’m trying to further pretraining MBartHez along with the copy mechanism to see what happens. Also, there are some weird things:In my experiments, the p_gen is almost always between 0.97 and 0.99., so, the final distribution (copy+gen) is very similar to the distribution of the decoder (gen), even in extractive tasks.During inference, thegeneratemethod gives a different output thantrainer.predict.The background for the implementation is this paper:https://aclanthology.org/2020.acl-main.125.pdf. There is more information in the comments of the code.Hope it helps!" }, { "date": "2021-12-16T12:25:33Z", "reply": "Hey@jogonba2, have you tried to verify the implementation of the copy mechanism? For example by using only the copy distribution (force settingp_gento 0) and training and testing the model on the simple task of just copying the complete input to the output?I’m currently trying to add the copy mechanism to T5 and currently my model is not able to do this yet." }, { "date": "2021-12-16T13:09:38Z", "reply": "tobigue:nly the copy distribution (force settingp_gento 0) and training and testing the model on the simple task of just copying the complete input to the [email protected] tested the p_gen=0 and p_gen=1 cases and the final distribution is the copy or the generation distribution respectively as expected. But I don’t tested it on “fully extractive” tasks.Also, I did few experiments on my downstream task (keyword extraction) fixing the p_gen to the percentage of novel words and it seems to work better than learning the p_gen value. For some reason p_gen is almost always very close to 1, but I’m not sure it is a problem.I think the implementation could be very similar for T5 models." }, { "date": "2022-05-23T02:56:16Z", "reply": "Hi@jogonba2, your github gist url is not found (or deleted). Can you check it or upload again? Thank you very much." }, { "date": "2022-05-23T10:34:17Z", "reply": "Hi@hoangftran,the gist was moved to another url, this is the new one:https://gist.github.com/jogonba2/f67d129e254054a918bf428d2e35aca4Thanks for letting me know!" }, { "date": "2022-05-31T06:59:08Z", "reply": "I have studied your implementation.It’s great. Thanks a lot.After I try to re-implement with encoder decoder model, I found there is a slicing problem (or indexing ?) at line 144.tensor e is been assigned -100 for its almost all values.I am not sure if it happens in bart models.I use the bert models instead of bart ones.I fixed bye = e.permute(0, 2, 1)\n e[(encoder_input_ids == self.config.pad_token_id),] = -100\n e = e.permute(0, 2, 1)Because I am not very familiar with the slicing methods, it looks a little dirty.Please let me know if there is any other better way to do it.Besides, it may get a better result if using the next-token prediction." }, { "date": "2024-02-23T04:23:24Z", "reply": "如何在Huggingface模型中优雅地加入Copy机制(PGN)? - 知乎 (zhihu.com)" } ]
AI for Low-Budget film making (an experiment)
https://discuss.huggingface.co/t/ai-for-low-budget-film-making-an-experiment/73201
0
406
Firstly I need to explain how floored I am by this platform and the amazing work everyone is doing - as a former computer engineer turned filmmaker I have an exceptionally keen interest in how AI will become a tool for independent and low budget filmmaking - I am wondering where I might find developers who might be willing to work with me on an experiment…At the moment, in my industry, AI is being touted as the nuclear bomb to take out Hollywood. The recent strikes had a heavy focus on this very topic. However - as a low-budget filmmaker, I see a tremendous potential to deploy AI generated elements as a way to offset an unrealistic budget and elevate production value. I’ve already had some success with this.What I am trying to figure out is this hypothetical : I have a screenplay that realistically would cost about $15mil to produce using the traditional model. However - what I have been proposing on various platforms is to approach the project as a hybrid AI/production model. Is there a current set of AI models where I would be able to accomplish this if all I wanted was ‘footage’ of the script? Like - does the shot list become the ‘prompt list’ and how to define which character is which (custom models I assume) - depending on what was easier, I would either have the AI model use voice cloning technolgies to synthesise the dialogue (as in some of those whisper spaces) or simply have actors record the lines and have the AI puppet it.In a sense I am just trying to figure out what I would need to pull this off in a way that it LOOKS like a $15 million film but at a fraction of that using AI technologies. I honestly see this becoming a huge industry if we could pull it off. Any input or potential collaborations are very welcome - in my estimation we are about 2-3 years away from this vision being a reality, but, that’s about how long it takes to fully produce a low budget film… So…Thank you all for your hard work. It is truly inspiring.
2024-02-14T18:26:52Z
[]
Conversational Search and Analysis of Collections of Letters and Comments
https://discuss.huggingface.co/t/conversational-search-and-analysis-of-collections-of-letters-and-comments/44463
3
590
IntroductionToday, public-sector personnel can, increasingly, utilize conversational search engines over large collections of letters and comments sent to elected representatives or in response to regulatory rulemaking processes. As the two publications shared below indicate, delivering these entirely realizable technologies to the public sector would greatly benefit democracy.Brainstorming, in the not-too-distant future, conversational AI agents could run scripts and interact with conversational search engines, on behalf of human personnel, to accelerate repetitive procedures involved with producing reports or dashboards.That is, beyond engaging in multi-step man-machine dialogue about collections of letters and comments, public-sector personnel could dispatch conversational AI agents which would interact on their behalf, in a procedural manner, with other conversational AI systems, e.g., conversational search engines, about large collections of letters and comments while producing valuable reports and dashboards.Interestingly, generated reports and dashboards could be open and transparent, public-facing and Web-based, so that citizens could also explore them.Below are two publications - with selected quotes - about how AI could be of use for empowering public-sector personnel to process bulk letters and comments sent to elected representatives or in response to regulatory rulemaking processes.AI Could Shore Up Democracy – Here’s One Way (link)"Consider individual letters to a representative, or comments as part of a regulatory rulemaking process. In both cases, we the people are telling the government what we think and want."For more than half a century, agencies have been using human power to read through all the comments received, and to generate summaries and responses of their major themes."In the absence of that ability to extract distinctive comments, lawmakers and regulators have no choice but to prioritize on other factors. If there is nothing better, ‘who donated the most to our campaign’ or ‘which company employs the most of my former staffers’ become reasonable metrics for prioritizing public comments. AI can help elected representatives do much better.“If Americans want AI to help revitalize the country’s ailing democracy, they need to think about how to align the incentives of elected leaders with those of individuals.”Implementing Federal-wide Comment Analysis Tools (link)"The federal government publishes tens of thousands of documents each year in the Federal Register, with over 800,000 total documents since 1994, which garner millions of submissions from the public (comments and other matter presented)."Agencies have a legal obligation to consider all relevant submissions and response to those which, significantly, would require a change to the proposed rule. To discern relevance, significance, and disposition, human review is needed."The capacity for human review often can’t meet the demand for high-volume comment events. Initial screening and classification allow regulator officials to focus on relevant submissions and response to groups of significant comments address the same topic. Some agencies perform independent, tailored analyses to assist with this initial screening.“The CDO Council recognized an opportunity to leverage recently advanced Natural Language Processing (NLP), which would be more efficient than these independent analyses. A generalizable toolset could provide effective comment grouping with less upfront effort, and this toolset could be shared and reused by rule makers across government to aid and expedite their comment analysis.”
2023-06-25T09:38:14Z
[ { "date": "2023-12-17T10:36:58Z", "reply": "I’m very happy to see that there are people who broadly share the same idea as meI’m Arnaud, a French citizen and a UX Design professional, deeply passionate about democracy and the potential of collaborative, participative governance. The rise of AI has opened my eyes to its vast potential in enhancing citizen involvement in democratic processes.Your proposal for “Conversational Search and Analysis of Collections of Letters and Comments” would be immensely valuable to citizens and/or decision-makers in accurately guiding their public policy. If this technology can evolve to be more robust, reliable, and efficient, its applications could extend beyond government, revolutionizing business and digital platforms by aligning decision-making more closely with employee and user interests.I believe we are touching upon a goldmine for the general interest, so kudos for your idea.Personally, I have been training myself in AI recently to understand the possibilities and technical limits with the goal of developing this type of tool, technology that would serve the general interest, whether it be for citizens, employees, or users worldwide.I see that you posted it on June 25th, where are you in your process?" }, { "date": "2023-12-17T21:10:39Z", "reply": "Arnaud, hello and thank you for the kind words. Many of these civic technology ideas are in need of implementors and I am excited to learn of your interest.I would like to invite you to join theW3C Civic Technology Community Groupwhere we discuss ideas such as these while sharing information, developments, and opportunities pertaining to civics and civic technology. Joining is fast, free, and easy to do." }, { "date": "2024-02-03T02:57:44Z", "reply": "@ArnaudC31, as interesting to you, here in the United States, the Chamber of Commerce’s National Institute of Standards and Technology (NIST) was requesting comments with respect to AI regulation. That period for comments closed today on February 2nd.https://www.nist.gov/news-events/news/2023/12/nist-calls-information-support-safe-secure-and-trustworthy-development-andhttps://www.nist.gov/artificial-intelligence/executive-order-safe-secure-and-trustworthy-artificial-intelligenceIn addition to their broader uses, AI-enhanced government-scale bulk comment analysis tools could have been and can be of use for unfolding discussions about AI and regulation." } ]
Free Access for Masters Dissertation
https://discuss.huggingface.co/t/free-access-for-masters-dissertation/71211
1
572
Hello,I am supervising a Masters Student who’s dissertation is titled:“Building a Generative AI-Powered Code Migration Pipeline for Application Modernisation”As you can probably guess from the title, the student is hoping to use Large Language Models to build a pipeline to migrate code projects/applications from one language/framework/version to another.As we all know, interacting with LLMs in a way that is in performant and reliable is expensive.I was curious, has anyone ever got access to to paid resources on hugging face, for example, the Pro Inference API for “free” as part of an academic endeavour? Or does anyone know of any process to request this from?Many thanks in Advance!John
2024-01-30T16:07:19Z
[ { "date": "2024-02-02T20:06:09Z", "reply": "John,As far as I’m aware, theProinference API does not come for free for academic projects, you have the free tier for that purpose. As for getting funding, the general approach is to apply for a research grant and to use your grant money towards your research." } ]
Tech skill embeddings
https://discuss.huggingface.co/t/tech-skill-embeddings/71024
0
231
Is there a Huggingface model that can return embeddings for tech skills?For example this one:Khushwant78/xlscout-techdata-embedding · Hugging FaceI would like to have model that gets high similarity forjavascriptandtypescript, and low forjavaandjavascript.
2024-01-29T11:07:03Z
[]
Profiling all layers of a model
https://discuss.huggingface.co/t/profiling-all-layers-of-a-model/70694
0
694
I want to profile all layers of a model, meaning the time, memory, performance (IPC for instance).From a Pytorch perspective, there is the Pytorch profiler (PyTorch Profiler — PyTorch Tutorials 2.2.0+cu121 documentation) and fordard/backward hooks to layers (this won’t allow me to measure the layer, only track the start of it).The Pytorch profile seems a good approach, but for models from Hugging Face fails to provide useful information about the layers.For instance, when using Pytorch profiler with the model GPT-J (fromGPT-J), I get the following output, which shows no layer but other auxiliary functions:---------------------- ------------ ------------ ------------ ------------ ------------ ------------ Name Self CPU % Self CPU CPU total % CPU total CPU time avg # of Calls ---------------------- ------------ ------------ ------------ ------------ ------------ ------------ forward 90.29% 558.000us 94.34% 583.000us 583.000us 1 aten::zeros 5.02% 31.000us 5.66% 35.000us 35.000us 1 aten::unbind 1.62% 10.000us 2.43% 15.000us 15.000us 1 aten::detach 0.49% 3.000us 1.29% 8.000us 8.000us 1 aten::select 0.65% 4.000us 0.81% 5.000us 5.000us 1 detach 0.81% 5.000us 0.81% 5.000us 5.000us 1 aten::empty 0.65% 4.000us 0.65% 4.000us 2.000us 2 aten::zero_ 0.16% 1.000us 0.16% 1.000us 1.000us 1 aten::as_strided 0.16% 1.000us 0.16% 1.000us 1.000us 1 aten::to 0.16% 1.000us 0.16% 1.000us 1.000us 1 aten::resolve_conj 0.00% 0.000us 0.00% 0.000us 0.000us 1 aten::resolve_neg 0.00% 0.000us 0.00% 0.000us 0.000us 1 ---------------------- ------------ ------------ ------------ ------------ ------------ ------------ Self CPU time total: 618.000usWhat would be the approach to profile all layers? Let me add that I’m running on only CPU.What would be the approach when running in a GPU? Is there a cross-platform mechanism?
2024-01-26T09:04:59Z
[]
How to get the probabilities of each class when we use T5 or Flan
https://discuss.huggingface.co/t/how-to-get-the-probabilities-of-each-class-when-we-use-t5-or-flan/70326
0
378
I am using the generative model (T5, Flan, etc) for classification. I have three classes. So it is a 3-class classification problem. The class labels are: Not vivid, moderately vivid, highly vivid. The model predicts the class labels. But I need to get the probability of each class similar to BERT model. If I fine-tuned a BERT model, It is easy to get the probability of each class. We need to add a SoftMax layer to the last year which returns the logits for each class. But the performance of BERT is not good for my scenario and using a generative model like T5 or Flan has a good performance. But I don’t know how to get the probabilities foreach classusing these generative models which output the probability distributionover the vocab not over the classes.
2024-01-23T22:18:44Z
[]
Researching ways to speed up WhisperAI startup
https://discuss.huggingface.co/t/researching-ways-to-speed-up-whisperai-startup/69869
0
326
Seasoned Front End Dev with background in C++. New to Python, Docker, WhisperAI. Using an RTX-3080 and Ryzen 5800X with 32GB or RAM for development.Got a Docker image/container of WhisperX going that I can tap for transcriptions.[WhisperX Docker Images]It works really well but there’s something I’m curious about. Whisper takes about 10 seconds to start transcribing each time I send over an audio file (using themedium model).Any way to mitigate those 10 seconds? Via Docker? Via built in functionality of Whisper/WhisperX?Wish there was a way to keep those startup scripts spun up so that the next Whisper request didn’t have to start from zero.Screenshot of Whisper’s output when initiating a transcription. It’s this startup process that I would like to know if it can be mitigated/reduced.image1263×394 181 KB
2024-01-20T09:26:58Z
[]
Strategies for Enhancing LLM's Understanding of a Complex Novel for Improved Question Answering
https://discuss.huggingface.co/t/strategies-for-enhancing-llms-understanding-of-a-complex-novel-for-improved-question-answering/69763
1
1,188
Hello Hugging Face Community,I am engaged in an ambitious project with a large and intricate English novel. The narrative of this novel is complex, with elements on one page often intricately linked to content in distant chapters. My goal is to enhance a Large Language Model’s (like GPT-3.5/GPT-4 or LLAMA2) understanding of this text, enabling it to accurately respond to detailed queries, particularly those that involve nuanced interrelationships.My initial approach involved a Retrieval-Augmented Generation (RAG) setup using LLamaIndex, VectorDB, and a knowledge graph. While this proved somewhat effective, it was also time-consuming and resource-intensive due to the need for scanning multiple text chunks for each query.I am now considering fine-tuning or pre-training a model specifically with my novel to improve its contextual understanding and recall. My queries are as follows:Fine-Tuning vs. Pre-Training for Novel-Specific Adaptation: In enhancing a model’s ability to understand and recall detailed plot elements and their connections within my novel, how effective is fine-tuning a model like GPT-3.5/GPT-4/llama2/mixtral? Alternatively, would pre-training be a more appropriate approach, despite its higher resource demands?Effectiveness of Pre-Training Smaller LLMs: Would pre-training smaller language models be an effective strategy for this purpose? If so, what are the trade-offs compared to using larger models?Focused Learning on Specific Chapters: If I aim to have the model learn a specific chapter of about 10,000 tokens, would fine-tuning enable the model to precisely memorize and recall details from this chapter?Limitations and Expectations: Considering the memory constraints of current LLMs, to what extent can fine-tuning aid in accurately answering questions that require understanding complex interrelations throughout the novel?Alternative Strategies: Are there other approaches or combinations, such as merging fine-tuning with a retrieval method, that I should consider to enhance the model’s understanding and question-answering accuracy?Practical Considerations: What are the practical aspects (such as computational resources and time investment) of fine-tuning versus pre-training a model for this kind of task?I seek your insights, experiences, and advice on the most effective approach to achieve profound understanding and efficient question-answering capabilities for my novel. Any guidance or suggestions you can provide would be immensely valuable.Thank you in advance for your assistance and insights.
2024-01-19T10:48:41Z
[ { "date": "2024-01-19T10:54:42Z", "reply": "Also, I’d like to add that the answers I received using the RAG approach were notably accurate. However, this method involved processing large chunks of text, each over 1000 tokens in size. The optimal results emerged when using a similarity_top_k of 8, leading to a total of approximately 8000 tokens (1000 tokens per chunk) being analyzed. Additionally, when factoring in the extra tokens required for prompt templates, plus around 2000 tokens for the completion responses, the total token count necessary to obtain a satisfactory answer ranged from 10,000 to 15,000. This process also typically took around a minute to generate a response.My hope in exploring pre-training or fine-tuning is anchored in the belief that it would represent a one-time cost, in contrast to the recurring token expenditure with each RAG-based query. Therefore, any guidance or suggestions from the community on how to effectively implement pre-training or fine-tuning for my novel, in light of these considerations, would be immensely valuable. I am particularly interested in understanding if these methods can reduce the token usage per query while maintaining or improving the accuracy and speed of responses.Thank you for considering my situation. I eagerly await any insights or advice you can provide." } ]
Facing issues in fine-tuning Vicuna-7b model
https://discuss.huggingface.co/t/facing-issues-in-fine-tuning-vicuna-7b-model/69641
0
488
Is there any way to keep the basic capability of the base model after the fine-tuning? we’re using the PEFT (Lora adapters) method for this fine-tuning. The dataset has around 500 chats. However, after the fine-tuning process, when I tried to include new instructions along with the original ones during testing, the model ignored the new instructions and stuck to the original ones it learned during the improvement process. I want that model should understand the new instructions that I am giving during the inference.Is there a way to preserve the fundamental abilities of the base model after the fine-tuning process?
2024-01-18T14:06:11Z
[]
Contextual Recommendation of Adages, Allusions, Anecdotes, Aphorisms, Jokes, Proverbs, Quotes, Lyrics, Poems, Stories, and Witticisms
https://discuss.huggingface.co/t/contextual-recommendation-of-adages-allusions-anecdotes-aphorisms-jokes-proverbs-quotes-lyrics-poems-stories-and-witticisms/67646
1
270
Hello. I would like to share some ideas with the community with respect to a research and development project.These ideas involve conversational search and recommender systems for wisdom materials including adages, allusions, anecdotes, aphorisms, jokes, proverbs, quotes, lyrics, poems, stories, and witticisms.One implementational approach involves using vector databases for wisdom materials and using dialogue-context vectors for looking up the wisdom materials. As envisioned, when end-users engaged in dialogues with AI systems, e.g., narrating personal experiences or occurrences, AI systems could conversationally recommend ranked lists of wisdom materials to those end-users.Any thoughts about or building upon these ideas? Thank you.
2024-01-01T23:15:40Z
[ { "date": "2024-01-15T21:30:24Z", "reply": "Should these topics interest you, I created a quick article:Artificial Intelligence and the Contextual Recommendation of Wit and Wisdom." } ]
Inference optimization with HPC
https://discuss.huggingface.co/t/inference-optimization-with-hpc/68207
2
507
Hello guys.I have a task where i need to optimize inference on a LLama model.The task involves creating a inference framework but not allowing to use a existing one such TensorRT-LLM and vLLM.Task description = "Enhance the baseline code by crafting a specialized, high-performance inference engine that aligns with the architectural traits of your HPC cluster. In the early stages, employ either FP16 or BF16 precision, depending on your computing devices, to steer away from exclusive focus on low-precision optimization. Strictly avoid using 8-bit or lower numerical precision. Your proposal should offer in-depth insights into the optimization strategies employed and the attained results.’The dataset is given too. And this is what is needed to sendLLM_inference Root directory.LLM_inference/Log Inference log file.LLM_inference/*.py Language model inference script or code files used in theinference process.LLM_inference/proposal Doc of pdf file including the results and the comprehensiveoptimization methods.LLM_inference/other_itemsI really not sure how to start and even tough i tried to think in something I just dont be able to move forward.I really appreciate your help guys, any hint is going to help me tons
2024-01-07T01:05:11Z
[ { "date": "2024-01-07T03:48:29Z", "reply": "Creating a specializedinferenceengine for an LLama model involves several steps and considerations. Here’s a high-level guide to help you get started:Understand LLama Model and Architecture:Familiarize yourself with the LLama model architecture, its components, and its computational requirements.Understand how the model is structured, its layers, and the operations it performs during inference.Hardware Profiling:Profile your HPC cluster to understand its hardware specifications and capabilities. Identify the computational resources available.Data Preparation:Prepare the dataset for inference. Ensure it’s formatted correctly and ready for use in your code.Programming Language and Frameworks:Choose a programming language (Python, C++, etc.) and frameworks/libraries that align with the hardware and model requirements. You mentioned not using existing inference engines, so you may have to work with low-level libraries for optimizations.Precision and Optimization Techniques:Decide on the precision level (FP16 or BF16) based on the capabilities of your computing devices. Implement these precisions in your code.Explore optimization strategies like:Parallelism: Utilize multi-threading or distributed computing if your hardware supports it.Memory Optimization: Optimize memory access patterns and minimize unnecessary data movement.Kernel Fusion: Combine multiple operations into a single kernel to reduce overhead.Cache Optimization: Ensure efficient utilization of CPU/GPU caches.Algorithmic optimizations: Modify algorithms or use approximation techniques where possible to reduce computational complexity.Inference Engine Development:Develop the inference engine according to the chosen language and optimization strategies.Implement the LLama model inference logic in your code, ensuring compatibility with the chosen precision and optimization techniques.Benchmarking and Testing:Benchmark your inference engine using the provided dataset. Measure its performance in terms of speed, accuracy, and resource utilization.Perform rigorous testing to ensure the correctness and efficiency of your inference engine.Documentation and Reporting:Create a comprehensive proposal or report documenting your optimization methods, strategies employed, results obtained, and insights gained during the process.Include the inference script or code files used, along with any necessary logs or additional items requested.Remember, this is a complex task that requires a deep understanding of both the LLama model and the optimization techniques suitable for your hardware. It might involve iterative improvements and fine-tuning to achieve the desired performance.Break down the task into smaller steps, tackle each step methodically, and keep experimenting and optimizing until you achieve the best possible results within the constraints provided." }, { "date": "2024-01-08T00:58:14Z", "reply": "Thanks a lot, Is it possible if i dm you?. Would love to discuss it further. Please lmk" } ]
Best use of a large dataset
https://discuss.huggingface.co/t/best-use-of-a-large-dataset/68176
0
226
We have a large unpublished dataset of about 100K kilometers of highway and city driving in more than half of USA states in many weather conditions and in days and at nights. The dataset has camera capture, gps position IMU data and steering angle and gas/brake position.I am wondering how this can be used in research settings other than how we use it in commercial setting.
2024-01-06T16:08:02Z
[]
Theme Extraction from Text
https://discuss.huggingface.co/t/theme-extraction-from-text/67372
1
1,579
I’m embarking on a project that involves creating a text classification model using Hugging Face’s transformers. The goal is to categorize a diverse dataset into a set of broad, predefined themes. Additionally, the model should be capable of suggesting new themes for entries that don’t fit into the existing categories.I am not sure if this would be a classification since here number of classes can be huge in hundreds. Also if I choose topic modelling it may give distnct themes for even similar text entries.Please suggest how to approach this.
2023-12-29T09:06:37Z
[ { "date": "2023-12-29T16:27:27Z", "reply": "Hi,This looks more like a clustering problem. See for instance this page:Clustering — Sentence-Transformers documentation." } ]
How can I replicate the research paper?
https://discuss.huggingface.co/t/how-can-i-replicate-the-research-paper/66616
1
608
I am at very starting stage in replicating research paper, could you provide me some tips ?
2023-12-21T13:00:26Z
[ { "date": "2023-12-22T17:57:29Z", "reply": "A lot to unpack here. Depends on the paper.As someone who recently tried to replicate the CANINE paper(you can find ithere) , you gotta be prepared to go down the rabbit hole of previous papers mentioned in the paper you’re trying to replicate. For example in the CANINE paper, they use something called hash embeddings. I had no idea what the hell that was. So I had to read that paper and replicate it. Rinse, repeat, and keep reading. You’re learning on top of learning.Don’t discouraged if it takes over an hour, a day, or even a week. Might be a while. Remember, the people on the paper probably took a long while to write and think about it, so don’t expect it to come easy.I recommend replicating it in torch since it’s the easiest. If you get stuck, try to look at the code repo if the paper has one. Don’t copy and paste their code unless you get really stuck, but it can help guide you in the right direction as to their thinking.As a smaller tip, don’t shy away using unoptimized things as well to get it to work. If the paper does some fancy function vectorization, but you find a for loop works/is easier, do that. Just get it to train.Most importantly, don’t give up! You got this. Don’t know if you need that encouragement, but I’ve been doing this for 6 years now and have a master’s degree and still feel like I don’t know what I’m doing lol. Learning this stuff should be fun and it’s the journey, not the end results.Happy replicating!" } ]
PPO using TRL: optimal strategy for reward calculation?
https://discuss.huggingface.co/t/ppo-using-trl-optimal-strategy-for-reward-calculation/65988
1
818
Hi everyone,Something I’ve been wondering recently and I’d value some input.I’ve been working with thetrllibrary to fine-tune various decoder-only LLMs via RLHF. During the PPO loop, I’ll collect the rewards using something like:raw_rewards = ppo_trainer.model.compute_reward_score(input_ids, attention_masks)Which will returns the class logits from the previously trainedAutoModelForSequenceClassificationmodel. We then need to turn these into a reward. I’ve seen different approaches to this, for example taking the first element of the logit (seehere) or taking the last element of the logit (seehere).Examining the code for the RewardTrainer we can see how the loss function is constructed (line 238) :loss = -nn.functional.logsigmoid(rewards_chosen - rewards_rejected).mean()If we denote the chosen and rejected rewards by the tuples (c1, c2) and (r1, r2) then we can write the above as:\begin{align} \mathcal{L} &= -\frac{1}{2} \left[ log \sigma \left(c_1-r_1\right) + log \sigma \left(c_2 - r_2\right) \right] \\ &= \frac{1}{2} \left[ log \left(e^{-r_1+c_1} + 1\right) + log \left(e^{-r_2+c_2} + 1\right) \right] \end{align}And see that the loss function is going to force weight updates that should causebothelements of the reward tuple to be driven towards a high score (for a chosen input) or a low score (for a rejected input). (Hence, presumably, why I have seen code which does both.)So, here’s the first question: should we be indifferent as to which element of the reward logit we hand to the PPO algorithm, or would it be even better to combine them - eg to sum them?And here’s the second question: thePPOTrainerallows us to apply batch-scaling and reward clipping to help stabilise gradients updates for the policy model, but why not just pass the reward logits through alogsigmoid()function first (mirroring the loss function)? That, after all, would mirror what the loss function in theRewardTraineris doing.Are there any theoretical reasons or implementation details that bear upon the above?
2023-12-15T20:52:23Z
[ { "date": "2023-12-20T09:17:48Z", "reply": "Cannot edit the post so correcting the typo in the second eqn above:\\frac{1}{2} \\left[ log \\left(e^{-c_1+r_1} + 1\\right) + log \\left(e^{-c_2+r_2} + 1\\right) \\right]" } ]
Special Digit Recognizer
https://discuss.huggingface.co/t/special-digit-recognizer/66210
0
288
Hello,I need help with following image.I tried to train some existing modules with it, but unfortunately without any useful results.Does anyone here have a useful tip as to which model would be best suited for this?
2023-12-18T13:46:04Z
[]
Looking for OCR post-processing for Visual Document Understanding
https://discuss.huggingface.co/t/looking-for-ocr-post-processing-for-visual-document-understanding/65937
0
573
Hi, I’m looking into models for feature and relation extraction tasks for Documents, such as LayoutLMv3, LiLT, DocTr etc.Many of them take image and text data with bounding boxes as input, likely coming from an OCR engine.My problem here is that these models seem to usually assume that a relevant item is located in exactly one text box.In the diligently annotated datasets such as FUNSD, this may be the case. However, common OCR outputs usually oversegment the text into many small boxes such that a persons first and last name for instance will not be in the same box, despite belonging together as a value to be extracted.I am fairly new to this subfield of ML and may be missing some common post-processing techniques people apply to OCR to get rid of this problem. I have not found a discussion of it in any papers yet. Does anyone here have experience with this kind of problem? I would greatly appreciate if someone could give me some advice on this or refer me to tutorials/discussions/papers on the matter.
2023-12-15T10:28:18Z
[]
Using Google's Gemini for scientific literature
https://discuss.huggingface.co/t/using-googles-gemini-for-scientific-literature/65804
0
1,351
Hello everybody,I’d like to know if anybody has tried using Gemini for research purposes or knows how to do this as shown in the video “Unlocking insights in scientific literature” here:Gemini - Google DeepMind. I am currently interested in using Gemini for a couple of my literature review projects and testing out its capabilities, however, the interface they use in the video is not Bard. Would like to create a step-by-step guide/ pipeline on how to implement this for research purposes if that has not been done already ( maybe you have seen some videos that explain how to do this?) Are they using Vertex AI as a platform in the video?https://cloud.google.com/vertex-ai?hl=en#how-it-works. Any help or insights on this are highly appreciated
2023-12-14T10:08:46Z
[]
Translation task for scarce language
https://discuss.huggingface.co/t/translation-task-for-scarce-language/65713
1
235
I am working to develop model which will translate from English to the language about which there is not much translated data. So I am thinking to pretrain model and then fine-tune on translation task. I read “attention is all you need” paper and concluded that they don’t use pretraining, which seems necessary if data is scarce. I am wondering if you know any paper, article or anything which will help me to acquire more knowledge about that topic. feel free to give as many suggestions as possible.
2023-12-13T18:58:32Z
[ { "date": "2023-12-14T09:38:04Z", "reply": "Maybe you should try this model:facebook/m2m100_418M · Hugging Face" } ]
Classifying NLP tasks based on prompts?
https://discuss.huggingface.co/t/classifying-nlp-tasks-based-on-prompts/65748
0
300
Hello, currently, I’m working on creating a chatbot for the company. I’ve been assigned the task of “classifying NLP tasks from prompts,” such as identifying if a user request is to summarize text or translate a passage. I’ve searched on Google but haven’t found a clear answer. Could you please advise on how to approach this task or share any relevant resources for research? Thank you.
2023-12-14T02:40:55Z
[]
How do i choose a optimal LLM for Pentesting
https://discuss.huggingface.co/t/how-do-i-choose-a-optimal-llm-for-pentesting/65420
2
969
Hi,im looking to create a automatic pentest-model based on a llm for my thesis.As im fairly new to llms i dont know which criteria are important for this specific use case.Does anyone has a idea or are there any project similar to mine without the use of Chat-GPT?
2023-12-11T18:54:53Z
[ { "date": "2023-12-12T16:43:14Z", "reply": "Hi,I believe LangChain can help you solve your problem.The principle involves using a series of connected Language Models (LLMs) where the output of one serves as the input for the next. You can also provide the model with a set of actions it can decide on its own to execute, such as running code (e.g., launching an NMAP) and interpreting the output to generate new actions.This approach facilitates functional interactions, allowing the model to perform actions.It is compatible with HuggingFace, so you can use models other than the OpenAI API.Check the documentation for more details.I hope this helps you." }, { "date": "2023-12-13T13:16:53Z", "reply": "Thank you very much for your help. As there are a lot of different models i dont know what to look for. Is there any model benchmark i can use for choose the right one?" } ]
LongLora fine-tuned model
https://discuss.huggingface.co/t/longlora-fine-tuned-model/65375
0
283
Since the LongLora model is already fine-tuned with the longer context length.So further fine-tuning it with my dataset can I do it with the Lora technique or do I have to use the LongLora ??
2023-12-11T14:46:29Z
[]
What to Monitor during training Val_Loss or Val_Accuracy?
https://discuss.huggingface.co/t/what-to-monitor-during-training-val-loss-or-val-accuracy/64672
0
335
Hi am currently working on a Multi model project which uses multiple CNN models to classify the images into classes. I am wondering about what will be best to monitor during the training phase in early stopping val_loss or val_accuracy?
2023-12-05T15:24:52Z
[]
What is Q* algorithm?
https://discuss.huggingface.co/t/what-is-q-algorithm/63518
0
269
If you find any new information regarding Q*leakedfrom openai, please share it here
2023-11-25T19:06:36Z
[]
Rust applications
https://discuss.huggingface.co/t/rust-applications/23060
6
4,768
Hi,Lately, I have been researching other programming languages that are more efficient than python. Also, I wanted to use that in ML applications from data gathering to preprocessing and beyond. As I research Rust looks like a great candidate and great work has been done:datafusionrust-bertand of course Fast version oftokenizer!I wanted other people’s opinions in the forum on Rust and its applications and the future of it.Thanks.
2022-09-13T05:54:12Z
[ { "date": "2022-11-07T19:10:28Z", "reply": "Apologies for bumping an older post, but I have a little bit of expertise in this area and wanted to share my experience.I’ve used Rust for a handful of ML projects, one to do image sorting (like Google Photos) and one to embed GPT-2 in a game. I’m partial to Tract (sonos/tract) because it allows one to embed an ONNX model file in the executable and doesn’t have any dependency on PyTorch DLLs, so you get a single small executable that “just works”. Tch-rs I thinkmayhave better ergonomics because you don’t have to do as much fiddling with the data before running the model, but you have an extra gigabyte or so of DLLs and dependencies that need to be deployed on the target system. Not so friendly.In general, I like Python for training models and doing the interactive data science components, but prefer Rust for the ability to deploy standalone applications that run in real-time scenarios." }, { "date": "2022-11-08T06:46:35Z", "reply": "Thanks,@JosephCatrambonefor the reply.I was curious about yourembed GPT-2 in a gameproject. if possible can you share what you’ve done?I recently did some minor research on how to boost data engineering and came acrosspolarsand thebenchmarkwas amazing!" }, { "date": "2022-11-10T03:50:32Z", "reply": "Sure. It was nothing complicated. I was trying something for the AI and Games Jam 2022. I used Godot as the base engine and built a GDNative script in Rust which embedded Tract and the ONNX distribution of GPT-2. It was too slow to be fun, but it worked.Here’s some of the code I used:Embedding GPT-2 in Godot via Rust · GitHubThe project would compile into a self contained dll and was able to be referenced from Godot." }, { "date": "2023-07-25T18:08:14Z", "reply": "I am newbie. What is the biggest difference between these programming languages?" }, { "date": "2023-08-28T17:36:47Z", "reply": "Apologies for the late reply. Python and Rust are fairly different in a lot of ways. I think it’s fair to say they’re about as different as apples and oranges. They’re not as different as Lisp and C or Haskell and Ruby, but they’re rather different.It can be challenging to describe what makes languages different from each other in a way that’s meaningful (or at least not surface-level) and approachable, but it can help to start with “what languages want to do as primary goals and what they don’t care about as non-goals.” Python cares about ‘readability’ and ‘productivity’. It does not care about ‘speed’ or ‘portability’. A project written in Python is harder to deploy on another system because it requires a whole constellation of dependencies that can’t be packaged with a given file. Python is “fast enough”, but not particularly fast, especially compared with C or Rust. Python has a LOT built into the standard library and language. They call this, “batteries included”. By comparison, C and JavaScript are extremely barebones. Rust cares about safety and speed over compile time and development time.On the surface, Rust and Python have a fair number of differences, too:Trait \\ LanguageRustPythonObjects/ClassingTrait-basedInheritance BasedSyntaxCurly bracesWhitespace DelimitedRuntimeCompiledInterpretedTypingStrong+Static TypingDuck/Weakly TypedStandard Library PhilosophyMinimalistCompleteProgramming ParadigmMostly imperativeMostly imperativeEnvironment and Build ToolingGreat (Cargo)Great (pip + pyenv)(Before folks yell at me about the ‘mostly imperative’ or the typing comments, I know these are simplifications.)Updates to the original discussion, while we’re here:In the time since the original reply was written there has been a veritable Cambrian explosion of learning solutions in Rust. I still personally enjoy using Python as the first place to develop models before moving them to Rust, but there are great options now:dfdx -dfdx - Rust- A pure-Rust CUDA accelerated learning toolkit.Burn -GitHub - burn-rs/burn: Burn - A Flexible and Comprehensive Deep Learning Framework in Rust- A flexible and comprehensive deep learning framework.tch-rs -GitHub - LaurentMazare/tch-rs: Rust bindings for the C++ api of PyTorch.- Bindings for the Torch library in Rust.tract -tract - Rust- A tiny, self-contained, no-nonsense library for using pre-trained models in Rust.Candle -GitHub - huggingface/candle: Minimalist ML framework for Rust- A minimalist library by HuggingFace for deep learning in Rust. Very new.Of these, I’ve only used tch, tract, and Candle. tch has a more friendly interface and can load PyTorch models, but includes the whole of the Torch library making for HUGE (near-gigabyte, last I checked) executables. Tract is the one I use most often for integrating trained ONNX models. Candle is a relative newcomer and doesn’t load architectures the same way that ONNX loaders will, but is still a quite promising candidate and I’ll probably spend some time playing with it in the months to come." }, { "date": "2023-11-21T22:33:03Z", "reply": "@JosephCatramboneare you on twitter and what is the user name so I can follow you?Newbie here." } ]
Better way of getting the Recommendations for an input text
https://discuss.huggingface.co/t/better-way-of-getting-the-recommendations-for-an-input-text/62510
0
285
I am working on scanning a Word file and creating chunks of data ignoring the table of contents, preamble, etc. These chunks are legal clauses which in turn refer to documents using a bert search from the index which has all documents in it and provides a recommendation for the clause based on the input. How can I improve the quality of recommendations as when the input clause is big in length or references other clauses it should not get recommendations. How do I deal with this?I am unable to find a pattern in clauses to identify one that shud get recommendations and one that should not. So is there any idea of how to deal with this?sample input clause:Valid clause: 11.1 Subject to clauses 10 and 11.2, the Sellers shall not make or authorise any public announcement or other communication or circular concerning the terms of any matter contemplated by or ancillary to this agreement unless they have first obtained the consent of the Buyer such consent not to be unreasonably withheld or delayed.Invalid clause: 6. Warranties and indemnities 6.1 The Sellers jointly and severally warrant to the Buyer in the terms of the Warranties. 6.2 Each Seller severally warrants to the Buyer in the terms set out in part 1 of schedule 4 in respect of himself only and no Seller shall be liable to the Buyer or any other person for the breach of any such warranty by any other Seller. 6.3 The Warranties are qualified by the facts and circumstances fully and fairly disclosed in the Disclosure Letter. 6.4 For the purpose of clause 6.3 fully and fairly disclosed means disclosed, whether generally or specifically, in such a manner and with such accuracy and sufficient detail so as to enable a reasonable purchaser to identify the nature and scope of the matter disclosed and to make an informed assessment of its effect. 6.5 Subject to clause 6.3: (a) no knowledge relating to the Company or the Shares, (constructive or imputed) shall prevent or limit a claim made by the Buyer for breach of clause 6.1; and (b) the Sellers may not invoke the Buyer’s knowledge, (constructive or imputed) of a fact or circumstance as a defence to a claim for breach of clause 6.1. 6.6 The Sellers waive and may not enforce a right which they may have in respect of a misrepresentation, inaccuracy or omission in or from information or advice supplied or given by the Company or any of its officers or employees for the purpose of assisting the Sellers to make a representation, give a Warranty or prepare the Disclosure Letter. 6.7 Each Warranty is to be construed independently and (except where this agreement provides otherwise) is not limited by the terms of any other Warranty or any other provision of this agreement. 6.8 Unless otherwise specified, where any Warranty refers to the knowledge, information, belief or awareness of the Sellers (or a similar expression) the Sellers shall be deemed to have such knowledge, information, belief or awareness as the Sellers would have obtained had the Sellers made all reasonable enquiries into the subject matter of that Warranty (including enquiries of the directors, officers, managers, agents and advisers of the Company). 6.9 Each Seller shall unconditionally and irrevocably agree and undertake to indemnify and keep indemnified and hold harmless the Buyer and/or the Company in the case of Clause 6.9(c) from and against, and covenant to pay to the Buyer on demand an amount equal to all costs (including costs of enforcement), loss, liability (including and tax liability), direct, indirect or consequential losses, damages, claims, expense or demand which the Buyer and/or the Company in the case of clause 6.9(c) may incur as a result of or in connection with: (a) breach of clause 6.2 by that Seller of the Warranties in part 1 of schedule 4 or of the covenants in clause 2; (b) any matters arising out of or in connection with the Transferred Business;
2023-11-16T16:04:49Z
[]
Extracting Training Data from GPT-2 (+ Differential Privacy)
https://discuss.huggingface.co/t/extracting-training-data-from-gpt-2-differential-privacy/6596
2
1,898
Carlini et al. (2020) (https://arxiv.org/pdf/2012.07805.pdf) show that it is possible to extract portions of training examples from language models. It would be cool to demo this with HuggingFace, then show that we can prevent this extraction by training these models in a differentially private manner. JAX is particularly well suited to running DPSGD efficiently, so this project is based on the Flax GPT-2 implementation.So far, inthis notebook, I fine-tuned GPT2 on wikitext, then tried to extract training examples from the model using the techniques proposed in Carlini et al. I have not been able to get any sections of wikitext, and no longer have the bandwidth to continue this project.If anyone’s interested in continuing this project, I’d be happy to help you get started.Roughly, here are some potential next steps:Successfully extract training samples some from the fine-tuned GPT-2.Use the filtering techniques described in the paper to extract training examples in a sample-efficient way (i.e. a large proportion of candidates are really from the training data).Fine-tune GPT-2 using DPSGD (example linked in notebook), ideally achieving a perplexity similar to the original.Demonstrate that no training samples can be extracted from the differentially private version.
2021-06-06T06:12:53Z
[ { "date": "2022-07-24T13:40:40Z", "reply": "I am interested in continuing this project. I have experience with differential privacy and other privacy preserving AI methods.I’ve took a look at the paper and the provided notebook and got the gist of it. Is there anything else I should keep in mind about this project?" }, { "date": "2023-11-09T03:43:33Z", "reply": "Nice to find this post as a rookie in DP field. Any update here?" } ]
HF Model count vs time
https://discuss.huggingface.co/t/hf-model-count-vs-time/61587
0
346
Hi huggingface communityHas anyone seen a good chart showing the number of models on HF per date?I’d be interested to se the growth profile!Thanks
2023-11-08T23:26:47Z
[]
What would be the best image-to-text model for a lot of images?
https://discuss.huggingface.co/t/what-would-be-the-best-image-to-text-model-for-a-lot-of-images/61570
0
823
I got more than 1,000,000 images which I need to describe with text (with 75 words/tokens or less).I’ve tried using CLIP and BLIP, but I find them fairly slow, as well as many times they yield unsatisfying results. I also wanted to experiment with BLIP 2, but don’t have the hardware to run it (I guess I could pay for cloud computing to run it, but I don’t know if it’s worth it nor how fast it would be). Added to that, I searched for other alternatives, but none seemed promising enough and got no one else to ask for advise.What do you think that could be solution to this problem (considering that I mostly care about the speed, but also a bit about the quality of the descriptions)?
2023-11-08T19:44:31Z
[]
New: Distributed GPU Platform
https://discuss.huggingface.co/t/new-distributed-gpu-platform/59932
2
618
Hey, HF community. My team and I are running a survey on a platform for distributed GPU. I would love your input here, or you can contact me on Twitter.Some questions we have for the community:Where do you rent GPUs?What is the first consideration when looking for a place to rent? Is it cost?What specific niche or field do you work in within the machine learning community?How does your niche differ from other ML communities regarding computing needs?What do you use to train your models? (e.g. AWS)Where do you get your data? Store your data?I appreciate any input. You can provide one-word answers.
2023-10-25T23:11:53Z
[ { "date": "2023-10-30T21:16:52Z", "reply": "I’m usually looking for inference with energy efficiency as key point and accuracy, F1 etc." }, { "date": "2023-11-08T13:00:16Z", "reply": "usually runpod, lambda, or whomever elsecosti train large scale open source(and closed source) models for general performance in generative tasks, usually llmsi am the drain by which the compute falls, the final destroyer of water (doing my best to fix that though!)if you mean trainers here, we have our own that weve built (axolotl, openchat)make it, usually - store on huggingface!" } ]
How to add your paper to your models or datasets metadata?
https://discuss.huggingface.co/t/how-to-add-your-paper-to-your-models-or-datasets-metadata/60337
2
731
Hi,Is it possible to add our papers to the metadata of our models or datasets on the Hugging Face Hub? I see some models and datasets have their arXiv papers added to the metadata of their models/datasets cards.Thank you.Saied
2023-10-29T19:11:46Z
[ { "date": "2023-10-30T14:39:37Z", "reply": "Hi, you can just include a link to a arxiv paper URL in your README.md:huggingface.coPaper PagesWe’re on a journey to advance and democratize artificial intelligence through open source and open science.Hope this helps!" }, { "date": "2023-10-30T20:47:27Z", "reply": "Thank you. This is helpful" } ]
Introducing an ASCII Maze Solver for Testing LLM Problem Solving
https://discuss.huggingface.co/t/introducing-an-ascii-maze-solver-for-testing-llm-problem-solving/60325
0
483
Hello everyone!I wanted to share a project I’ve been working on that’s designed to test the problem-solving abilities of Large Language Models (LLMs), especially when it comes to breaking down complex problems into more manageable components.About the Project:The tool is a manual maze solver that visualizes ASCII mazes. After every move, it generates a map with the absolute position. This provides a feedback loop which can be used to engage with models like ChatGPT to understand and reason through maze-solving in real-time.Key Features:Visualizes ASCII mazes of various sizes.Provides real-time feedback on the solver’s position after every move.Aims to facilitate interactions to test and evaluate LLM’s ability to reason, break down problems, and navigate complex environments.Repository Link:ASCII_LLM_MazeI believe it can serve as an interesting testbed for those looking to push the boundaries of what LLMs can achieve. I’d love to get feedback, suggestions, or any insights you might have. Let’s explore the capabilities of LLMs together!
2023-10-29T15:52:33Z
[]
How to correctly cite Hugging Face Transformer model_doc
https://discuss.huggingface.co/t/how-to-correctly-cite-hugging-face-transformer-model-doc/50185
1
6,608
Hi,could somebody suggest how to cite a hugging face library in the correct way?I want to cite this for example, but there is no date, no author, …huggingface.coVision Encoder Decoder ModelsWe’re on a journey to advance and democratize artificial intelligence through open source and open science.Thanx
2023-08-09T20:20:52Z
[ { "date": "2023-10-25T10:28:20Z", "reply": "Hello,@Ficht!Not sure what the best way of citing that is, but if no other natural alternatives come to rise, I would recommend citing the Hugging Face Transformers arXiv paper, which presents the overall Transformers framework:arXiv.orgHuggingFace's Transformers: State-of-the-art Natural Language ProcessingRecent progress in natural language processing has been driven by advances in both model architecture and model pretraining. Transformer architectures have facilitated building higher-capacity models and pretraining has made it possible to..." } ]
Study of contextual similarity of sentences
https://discuss.huggingface.co/t/study-of-contextual-similarity-of-sentences/59475
0
225
HiI am trying to do a study on the contextual similarity models. The setting is in the classroom, and we wish to determine if a student’s response is relevant to the teacher’s speech.For example,Teacher: " whats your favorite sport"Student: ‘I like pizza’This means the answer is deviated.Whats the best way to approach this, Q&A or Semantic Textual Similarity?
2023-10-22T20:20:54Z
[]
VAE for Motion Sequence Generation - Convergence Issue when using Scheduled Sampling
https://discuss.huggingface.co/t/vae-for-motion-sequence-generation-convergence-issue-when-using-scheduled-sampling/58978
0
270
I implemented a Variational Autoencoder (VAE) in PyTorch for motion sequence generation using human pose data (joint angles and angular velocities in radians) from the CMU dataset. The VAE architecture consists of an encoder and a decoder, each with two layers, comprised of a Conv1D layer and an ReLu activation for each layer.During training, I input a sequence of 121 poses (60 prev pose + current pose (p(n)) + 60 next pose in the dataset) and the VAE generates the next pose (p_hat(n+1)).I also have tried with normalized joint angles and angular velocities but it worsens the convergence.Here’s an overview of my training process:Loss Function:Initially trained for 30 epochs using Mean Squared Error (MSE) loss by comparing the generated next pose with ground truth data from the CMU dataset.loss = MSE(p(n+1), p_hat(n+1))From epoch 31 to 60, I added the KL divergence to the loss function.loss = MSE(p(n+1), p_hat(n+1)) + KLScheduled Sampling:Starting from epoch 61, I applied scheduled sampling, gradually increasing the probability p from 0.0 to 1.0 over 20 epochs (epoch 61 to 80).From epoch 81 onwards, p is set to 1, implying that the generated next pose is fed into the model as the current pose to generate the next pose.The length of scheduled sampling is 8 (I autoregressively create next 8 poses, inputting the generated pose of the VAE)The Issue:The network converges nicely on the MSE loss, a bit slower on MSE+KL, but it fails to converge when scheduled sampling is applied.My Questions:Is there a potential reason why the model doesn’t converge during the scheduled sampling phase?Are there any adjustments or insights regarding the VAE structure or training parameters that could help resolve this issue and improve convergence during scheduled sampling?VAE Structure and Parameters:Encoder and Decoder: Each with two layers (Conv1D + ReLu activation)Loss: MSE initially, then MSE+KLScheduled Sampling: Gradual increase of sampling probability p from 0.0 to 1.0 over epochs 61 to 80, then p set to 1 from epoch 81.class Encoder(nn.Module): def __init__(self, latentDim, inputFeatDim, frameSequence, intermediate_channels): super(VariationalEncoder, self).__init__() #intermediate_channels = 256 # layer 1 self.convLayer1 = nn.Conv1d(in_channels = inputFeatDim, out_channels = intermediate_channels, kernel_size = 1, padding = 0, padding_mode = 'zeros', bias = True) # layer 2 self.convLayer2 = nn.Conv1d(in_channels = intermediate_channels + inputFeatDim, out_channels = intermediate_channels, kernel_size = 1, padding = 0, padding_mode = 'zeros', bias = True) self.downSamepleLayer = nn.Linear(in_features= frameSequence, out_features=1, bias=True) self.muLayer = nn.Conv1d(in_channels=intermediate_channels, out_channels=latentDim, kernel_size=1, padding=0, padding_mode='reflect') self.logVarLayer = nn.Conv1d(in_channels=intermediate_channels, out_channels=latentDim, kernel_size=1, padding=0, padding_mode='reflect') self.normalDist = torch.distributions.Normal(0, 1) self.normalDist.loc = self.normalDist.loc.cuda() self.normalDist.scale = self.normalDist.scale.cuda() self.kullbackLeibler = 0 self.latent = torch.zeros(1).cuda() #self.print_f = True def forward(self, x): input = x x = self.convLayer1(x) l1_output = x x = torch.relu(x) x = self.convLayer2(torch.cat((input, x),dim=1)) x = torch.relu(x) x = self.downSamepleLayer(x) mu = self.muLayer(x) # input here must be(latentDim) logVar= self.logVarLayer(x) self.latent = mu + torch.exp(0.5 * logVar)*self.normalDist.sample(mu.shape) self.kullbackLeibler = ((torch.exp(logVar) + mu**2)/2 - 0.5 * logVar - 0.5).sum()/(logVar.size()[0]) # logVar size ----> [batch_size * latentDim * 1] return self.latent, self.kullbackLeiblerclass Decoder(nn.Module): def __init__(self, latentDim, inputFeatDim, poseFeatDim, frameSequence, intermediate_channels): super(Decoder, self).__init__() self.LatentExpander = nn.Linear(in_features=latentDim, out_features=poseFeatDim) # entry layer entry_in_channels = latentDim + poseFeatDim self.entryLayer = nn.Conv1d(in_channels = entry_in_channels, out_channels = intermediate_channels, kernel_size = 1, padding = 0, padding_mode = 'zeros', bias = True) # hidden layer 1 self.convLayer1 = nn.Conv1d(in_channels = intermediate_channels+entry_in_channels, out_channels = intermediate_channels, kernel_size = 1, padding = 0, padding_mode = 'zeros', bias = True) def forward(self, latent, cur_pose): cur_pose = cur_pose.unsqueeze(2) x = torch.cat([latent, cur_pose], dim = 1) input = x x = self.entryLayer(x) x = torch.relu(x) x = self.convLayer1(torch.cat((input, x), dim=1)) x = torch.relu(x) x = self.finalLayer(x) return xclass VAE(nn.Module): def __init__(self, Encoder, Decoder): super(VAE, self).__init__() self.encoder = Encoder self.decoder = Decoder def forward(self, seq, cur_pose): latent, kullbackLeibler = self.encoder(seq) X_hat = self.decoder(latent, cur_pose) return X_hat, latent, kullbackLeiblerHere is my train function:def train(VAE, data, device, optimizer, load_saved_model, epochs_before_KL, draw_pose, poseFeatDim, scheduled_sampling_length, epochs, lr, lr_init, lr_final, latentDim, frameSequence, first_train_stage_epochs, second_train_stage_epochs): N = int((frameSequence-1)/2) # pose sequences before and after current pose if load_saved_model==True: alpha = 1.0 else: alpha = 0.0 for epoch in range(epochs): epoch_KL = 0 if epoch == epochs_before_KL: alpha = 1.0 epoch_loss= 0 if epoch > (first_train_stage_epochs+second_train_stage_epochs-1): lr = lr_init - (lr_init-lr_final)*(epoch-(first_train_stage_epochs+second_train_stage_epochs))/(epochs-(first_train_stage_epochs+second_train_stage_epochs)) optimizer.lr = lr for X, target, cur_frame_idx in data: X = torch.permute(X, (0, 2,1)).type(torch.FloatTensor).to(device=device) X_hat = (X[:,:,N].clone()).unsqueeze(2).cuda()#to(device=device) for l in range(scheduled_sampling_length): train_loss = 0 optimizer.zero_grad() cur_X = (X[:,:,l:frameSequence+l].clone()).to(device=device) cur_pose = (cur_X[:, 0:poseFeatDim, N].clone()).to(device=device) GT = (cur_X[:,0:poseFeatDim, N+1].clone()).unsqueeze(2).cuda() # scheduled sampling if load_saved_model==True: p=0 elif epoch<first_train_stage_epochs: p = 1 elif epoch<first_train_stage_epochs+second_train_stage_epochs: w1 = (epoch - first_train_stage_epochs+1)/second_train_stage_epochs w2= 1-w1 weights = torch.tensor([w1, w2], dtype=torch.float).cuda() p = torch.multinomial(weights, 1, replacement=True).cuda().item() else: p = 0 input_pose = p * cur_pose.detach().cuda() + (1-p)* X_hat[:,0:poseFeatDim,:].detach().squeeze(2).cuda() X_hat, latent, KL_loss = VAE(cur_X, input_pose) recon_loss = (((GT - X_hat[:,0:poseFeatDim,:])**2).sum())/(GT.size(dim=0)) # GT shape ----> [batch_size, inputFeatDim, 1] train_loss = recon_loss + KL_loss * alpha train_loss.backward() epoch_loss += train_loss epoch_KL += KL_loss optimizer.step() print("epoch: " + str(epoch)+" loss: " + str(epoch_loss.item()) + " KL: " + str(epoch_KL.item() * alpha)) return VAE, X, latent[0,:,:].unsqueeze(0), X[0,:,N].unsqueeze(0), epoch_loss, optimizerAnd, the output of training stage is:cuda available data unit is radian epoch: 0 loss: 30499.1171875 KL: 0.0 epoch: 1 loss: 4208.41015625 KL: 0.0 epoch: 2 loss: 498.6940002441406 KL: 0.0 epoch: 3 loss: 158.99220275878906 KL: 0.0 epoch: 4 loss: 78.93453216552734 KL: 0.0 epoch: 5 loss: 53.533302307128906 KL: 0.0 epoch: 6 loss: 38.02873611450195 KL: 0.0 epoch: 7 loss: 28.048128128051758 KL: 0.0 epoch: 8 loss: 23.194978713989258 KL: 0.0 epoch: 9 loss: 21.458599090576172 KL: 0.0 epoch: 10 loss: 20.632036209106445 KL: 0.0 epoch: 11 loss: 20.297395706176758 KL: 0.0 epoch: 12 loss: 18.75624656677246 KL: 0.0 epoch: 13 loss: 17.753822326660156 KL: 0.0 epoch: 14 loss: 16.912155151367188 KL: 0.0 epoch: 15 loss: 16.498188018798828 KL: 0.0 epoch: 16 loss: 15.184914588928223 KL: 0.0 epoch: 17 loss: 14.235843658447266 KL: 0.0 epoch: 18 loss: 13.30086898803711 KL: 0.0 epoch: 19 loss: 12.536004066467285 KL: 0.0 epoch: 20 loss: 11.863930702209473 KL: 0.0 epoch: 21 loss: 10.70985221862793 KL: 0.0 epoch: 22 loss: 10.140275001525879 KL: 0.0 epoch: 23 loss: 9.719818115234375 KL: 0.0 epoch: 24 loss: 7.877124309539795 KL: 0.0 epoch: 25 loss: 6.41648006439209 KL: 0.0 epoch: 26 loss: 5.2640767097473145 KL: 0.0 epoch: 27 loss: 4.675246238708496 KL: 0.0 epoch: 28 loss: 4.752994060516357 KL: 0.0 epoch: 29 loss: 4.260623455047607 KL: 0.0 epoch: 30 loss: 208.68763732910156 KL: 1771.3675537109375 epoch: 31 loss: 18.421226501464844 KL: 7.0814619064331055 epoch: 32 loss: 16.831327438354492 KL: 0.2619243860244751 epoch: 33 loss: 16.36933708190918 KL: 0.22026295959949493 epoch: 34 loss: 16.225860595703125 KL: 0.1161663681268692 epoch: 35 loss: 16.09817123413086 KL: 0.14859028160572052 epoch: 36 loss: 16.100046157836914 KL: 0.164580836892128 epoch: 37 loss: 15.891282081604004 KL: 0.13011851906776428 epoch: 38 loss: 15.863426208496094 KL: 0.1438782811164856 epoch: 39 loss: 15.77467155456543 KL: 0.0739947035908699 epoch: 40 loss: 15.756997108459473 KL: 0.1154341995716095 epoch: 41 loss: 15.682149887084961 KL: 0.13609440624713898 epoch: 42 loss: 15.646101951599121 KL: 0.14060918986797333 epoch: 43 loss: 15.596468925476074 KL: 0.06942499428987503 epoch: 44 loss: 15.487974166870117 KL: 0.13864728808403015 epoch: 45 loss: 15.456522941589355 KL: 0.09747464954853058 epoch: 46 loss: 15.596013069152832 KL: 0.10960092395544052 epoch: 47 loss: 15.446678161621094 KL: 0.09400694817304611 epoch: 48 loss: 15.414061546325684 KL: 0.07403453439474106 epoch: 49 loss: 15.446662902832031 KL: 0.07924196124076843 epoch: 50 loss: 15.337182998657227 KL: 0.07696129381656647 epoch: 51 loss: 15.423378944396973 KL: 0.1136254072189331 epoch: 52 loss: 15.3486967086792 KL: 0.09196256101131439 epoch: 53 loss: 15.432474136352539 KL: 0.11669618636369705 epoch: 54 loss: 15.23315143585205 KL: 0.08362749963998795 epoch: 55 loss: 15.270442962646484 KL: 0.0592842772603035 epoch: 56 loss: 15.257233619689941 KL: 0.08109745383262634 epoch: 57 loss: 15.207656860351562 KL: 0.058704279363155365 epoch: 58 loss: 15.246068954467773 KL: 0.08804851025342941 epoch: 59 loss: 15.179248809814453 KL: 0.06591930240392685 epoch: 60 loss: 16.24458122253418 KL: 0.05520284175872803 epoch: 61 loss: 18.20315170288086 KL: 0.07300713658332825 epoch: 62 loss: 20.9660701751709 KL: 0.10368426144123077 epoch: 63 loss: 26.014833450317383 KL: 0.1356126070022583 epoch: 64 loss: 35.390743255615234 KL: 0.1684873253107071 epoch: 65 loss: 32.68571090698242 KL: 0.14424605667591095 epoch: 66 loss: 52.215614318847656 KL: 0.26431578397750854 epoch: 67 loss: 189.5343017578125 KL: 1.0707039833068848 epoch: 68 loss: 75.52210235595703 KL: 0.23325027525424957 epoch: 69 loss: 143.2079620361328 KL: 0.38768690824508667 epoch: 70 loss: 157.3100128173828 KL: 0.49191996455192566 epoch: 71 loss: 192.56976318359375 KL: 0.829379677772522 epoch: 72 loss: 258.619873046875 KL: 0.6730182766914368 epoch: 73 loss: 521.1996459960938 KL: 3.7076361179351807 epoch: 74 loss: 330.8260803222656 KL: 0.9579944014549255 epoch: 75 loss: 604.3058471679688 KL: 1.2703361511230469 epoch: 76 loss: 475.0205078125 KL: 0.9360959529876709 epoch: 77 loss: 731.9593505859375 KL: 2.7841150760650635 epoch: 78 loss: 975.5214233398438 KL: 1.2265475988388062 epoch: 79 loss: 924.7633056640625 KL: 0.873565673828125 epoch: 80 loss: 940.7155151367188 KL: 0.5359449982643127 epoch: 81 loss: 855.8935546875 KL: 0.9077990651130676 epoch: 82 loss: 849.4100952148438 KL: 0.7129514813423157 epoch: 83 loss: 743.1096801757812 KL: 0.5308371782302856 epoch: 84 loss: 849.7276611328125 KL: 0.9092111587524414 epoch: 85 loss: 806.3848876953125 KL: 0.49240317940711975 epoch: 86 loss: 773.6209716796875 KL: 0.35794520378112793 epoch: 87 loss: 714.7335815429688 KL: 0.36182066798210144 epoch: 88 loss: 725.5518188476562 KL: 0.6665423512458801 epoch: 89 loss: 725.10498046875 KL: 0.3123415410518646 epoch: 90 loss: 749.900634765625 KL: 0.5664316415786743 epoch: 91 loss: 746.6582641601562 KL: 0.8775449395179749 epoch: 92 loss: 740.4017944335938 KL: 0.4976818263530731 epoch: 93 loss: 709.8568115234375 KL: 0.34913212060928345 epoch: 94 loss: 716.6048583984375 KL: 0.7065077424049377 epoch: 95 loss: 681.2711181640625 KL: 0.36696088314056396 epoch: 96 loss: 740.9374389648438 KL: 0.803412675857544 epoch: 97 loss: 646.1436767578125 KL: 0.2696443796157837 epoch: 98 loss: 664.8652954101562 KL: 0.37316083908081055 epoch: 99 loss: 614.1035766601562 KL: 0.2937750816345215 epoch: 100 loss: 703.1944580078125 KL: 0.4119395315647125 epoch: 101 loss: 644.4376220703125 KL: 0.36282405257225037 epoch: 102 loss: 673.5081176757812 KL: 0.35550656914711 epoch: 103 loss: 599.3011474609375 KL: 0.18692539632320404 epoch: 104 loss: 589.5043334960938 KL: 0.33308255672454834 epoch: 105 loss: 589.5310668945312 KL: 0.20958860218524933 epoch: 106 loss: 633.5597534179688 KL: 0.3015775978565216 epoch: 107 loss: 587.228271484375 KL: 0.2859556972980499 epoch: 108 loss: 633.8538818359375 KL: 0.3062727153301239 epoch: 109 loss: 576.3986206054688 KL: 0.3453579843044281 epoch: 110 loss: 605.309814453125 KL: 0.7614783048629761 epoch: 111 loss: 559.1953735351562 KL: 0.43579205870628357 epoch: 112 loss: 601.722412109375 KL: 0.31123608350753784 epoch: 113 loss: 591.31494140625 KL: 0.38346976041793823 epoch: 114 loss: 677.573974609375 KL: 1.5325040817260742 epoch: 115 loss: 535.7906494140625 KL: 0.2391374409198761 epoch: 116 loss: 550.9417114257812 KL: 0.5806562900543213 epoch: 117 loss: 565.160400390625 KL: 0.31043145060539246 epoch: 118 loss: 584.8384399414062 KL: 0.8044378757476807 epoch: 119 loss: 616.1946411132812 KL: 0.9010312557220459 epoch: 120 loss: 589.0029907226562 KL: 0.5001609325408936 epoch: 121 loss: 558.1272583007812 KL: 0.36073750257492065 epoch: 122 loss: 522.8496704101562 KL: 0.4064602553844452 epoch: 123 loss: 563.9342651367188 KL: 0.2904842495918274 epoch: 124 loss: 562.810791015625 KL: 0.5313525199890137 epoch: 125 loss: 608.248046875 KL: 0.7063066363334656 epoch: 126 loss: 517.7711791992188 KL: 0.2636258602142334 epoch: 127 loss: 525.2127075195312 KL: 0.2245425432920456 epoch: 128 loss: 576.1654663085938 KL: 0.6417035460472107 epoch: 129 loss: 583.733642578125 KL: 0.47674331068992615 epoch: 130 loss: 522.4052124023438 KL: 0.34901681542396545 epoch: 131 loss: 565.4308471679688 KL: 0.232156440615654 epoch: 132 loss: 553.7698364257812 KL: 0.323140025138855 epoch: 133 loss: 586.9306640625 KL: 1.2630860805511475 epoch: 134 loss: 488.27557373046875 KL: 0.43516507744789124 epoch: 135 loss: 527.9531860351562 KL: 0.3459720313549042 epoch: 136 loss: 548.0935668945312 KL: 0.4123835861682892 epoch: 137 loss: 543.787841796875 KL: 0.2853831350803375 epoch: 138 loss: 536.0159912109375 KL: 0.27312254905700684 epoch: 139 loss: 546.4530639648438 KL: 0.5541123151779175
2023-10-18T11:24:52Z
[]
族谱修复整理·Genealogy repair maintenance
https://discuss.huggingface.co/t/genealogy-repair-maintenance/58541
0
314
数据集(dataset):mmhzlrj/Genealogyfrom datasets import load_datasetdataset = load_dataset(“mmhzlrj/Genealogy”)您好!我是一位AI的初学者,了解到layoutlmv3是处理NLP的一个非常强大的多模态大模型,希望使用它做一件非常有意义的事情。但是我不懂如何使用这个模型微调和识别图片来完成我想要实现的族谱修复整理任务:识别族谱的文字排版,将扫描版的图片转化成可以选择文字的PDF识别内容,生成以人物卡(姓名:生-死,藏地,学历,子嗣,事迹等一切识别出来的标签内容)由人物卡连接成树的图形化的家族树Hello! I am a beginner in AI and have learned that layoutlmv3 is a very powerful multimodal model for handling NLP. I hope to use it to do something very meaningful. But I don’t know how to use this model to fine tune and recognize images to complete the Genealogy repair maintenance.To do list:Recognize the text layout of the genealogy and convert scanned images into PDF with selectable textIdentify the content and generate tag content with character cards (name: DOB-DOD, burial site, educational background, descendants, events, etc.)A graphical family tree connected by character cards into a treeThanksSample:0011180×1800 301 KB
2023-10-14T09:39:10Z
[]
Does anyone need an extra pair of hands?
https://discuss.huggingface.co/t/does-anyone-need-an-extra-pair-of-hands/58476
1
395
I am a researcher in the field of ml4science and am currently on a sabbatical while awaiting confirmation on my next job offer. And I am itching to put myself to some good use and in particular I wanted to get some experience working with NLP and CV and all the new generative AI models.My skills:I work primarily with PyTorch and usually work with point cloud data, using Graph Neural Networks and Neural Operators.I write my own models and scale them to multi-gpu and multi-node setups running on SLURM environments. Paralleization is accomplished with DDP and Deepspeed (model parallel and pipeline parallel) and also through custom approaches by writing my own PyTorch Cuda kernels (my CUDA skills are pretty basic but am interested in getting more experience in this area). I also worked with torch.rpc directly and with MPI.If you are are interested in working with me reach out at: pawlatwork @ g _ mail . … comI am not seeking any financial compensation.
2023-10-13T16:29:59Z
[ { "date": "2023-10-14T09:36:12Z", "reply": "Hello! I am a beginner in AI and have learned that layoutlmv3 is a very powerful multimodal model for handling NLP. I hope to use it to do something very meaningful. But I don’t know how to use this model to fine tune and recognize images to complete the Genealogy repair maintenance.To do list:Recognize the text layout of the genealogy and convert scanned images into PDF with selectable textIdentify the content and generate tag content with character cards (name: DOB-DOD, burial site, educational background, descendants, events, etc.)A graphical family tree connected by character cards into a treeThanks" } ]
Network digital twin for cybersecurity
https://discuss.huggingface.co/t/network-digital-twin-for-cybersecurity/58187
0
393
Hi all,for a text work of mine I am trying to do a project based on generating digital twin of networks. My goal is to create a digital twin of a network and then work on it from a cyber security point of view. I will briefly explain what I would like to do.I am currently using software for network vulnerability scans (OpenVAS). I use this software to perform network vulnerability scans at the network level, so basically to OpenVAS I pass a network (for example 192.168.xx.xx/24) to automatically identify all the vulnerabilities that are there.The next step ( what I’d like to do and that’s why I’m asking for your advice) is to create a digital twin of the newly scanned network and then perform a penetration test on this digital twin of the network, without going to stress the actual network.Ideally, I would like to pass the output of the OpenVAS vulnerability scans, routing rules, and firewall rules to some tool that will then generate for me the digital twin of the network, which will then be used for offensive cybersecurity, so exploits, privilege escalation, etc… will be tested on this digital twin without worrying about breaking some kind of service or stressing the real network.What I am asking is, do you know of any tool that would do the trick for me? So some tool that allows me to generate a digital twin of a network by providing as input vulnerability scans (xml,json,csv etc…), routing rules, firewall rules, pcap traces etc…Do you have any references or documentation?Are you aware of any open source tools?I thank you for your helpfulness!
2023-10-11T15:50:43Z
[]
Very slow training (>5mins per batch) - code review request
https://discuss.huggingface.co/t/very-slow-training-5mins-per-batch-code-review-request/58087
2
586
I’d like some help withQARAC, my research project on creating language models that encode logic and consistency.I’ve recently ported the code from Tensorflow to PyTorch, since I need to train three models together against a combination of four objectives, and PyTorch appears to be more suitable for this than TensorFlow. I thought it would be sensible to test the training script on my own laptop before spending lots of computing resources and money on training it. When I did so, I found that single batch of data took over 5 minutes to process. This suggests to me that even with GPUs or TPUs, training this model would be intractable as it stands, and also that there are likely to be significant inefficiencies in my code.I’d really appreciate it if somebody could go over the code with me and try to help me spot any problems with it.
2023-10-10T20:39:54Z
[ { "date": "2023-10-11T02:27:18Z", "reply": "You need to actually move your data and model to the GPU. Akamodel.cuda()and all of your inputs as well (but dox = x.cuda()since it’s not an inplace operation like it is with models). Right now you’re just training on your CPU, hence why it is so slow" }, { "date": "2023-10-11T06:32:50Z", "reply": "I know that I need to do that, but I’m worried that it’s so slow that it will still be very slow on GPUs, and I’d like to check that there isn’t some underlying inefficiency before doing it." } ]
Tokenizer effect on the fine-tuning
https://discuss.huggingface.co/t/tokenizer-effect-on-the-fine-tuning/57650
0
359
Hi everyone, I’m on a project to fine-tune multiple 7B and less text2text generation models on arabic and i was wondering about the effect of the original tokenizer on the fine tuning process or what if i use a tokenizer different from the model’s original one! Let’s say BLOOM tokenizer, Will that hurts the model’s performance? So if anyone have seen a paper to discuss this or something similar please drop it here it will be really beneficial or simply comment your thoughts
2023-10-06T17:19:06Z
[]
LLM for cyberbullying intervention - profanity issues
https://discuss.huggingface.co/t/llm-for-cyberbullying-intervention-profanity-issues/57108
2
502
I am doing my Master’s project on building a chatbot to monitor social networking sites for cyberbullying. The chatbot uses BLSTM for the detection engine, which works reasonably well. Messages detected as cyberbullying are then sent to hugchat with a request for a response which the chatbot then posts as a reply to the cyberbullying message. The prompt looks like this:my_query = "The following comment has been detected as " +"cyberbullying against an individual. " +“Commment = {” + my_comment.body + "}. " +"Provide a response to this comment as though you are a " +"bystander who wants to show support for the victim, "+"with the primary goal of mitigating the impact of this " +"cyberbullying comment on their mental health. " +"Your response should be both empathetic and respectful. " +"Your response should be no longer than ten sentences and written in " +"a casual tone appropriate for social media. " +"Your response should be written in the persona of " +"a 30-year old person who lives in the USA, has a liberal " +“arts education, and is technically adept.”This works very well if the cyberbullying comment does not contain profanity. Unfortunately, most cyberbullying messages do contain profanity. When that happens, the response back from hugchat is along the lines of “I cannot provide a response that would engage in name-calling or personal attacks as it would go against my programming rules”. This response is obviously unhelpful, and isn’t what the prompt is asking for. I am wondering if anyone has encountered similar issues, and if there is anything I can add to the prompt to get it to provide an appropriate response. Thank you!
2023-10-02T13:05:42Z
[ { "date": "2023-10-02T13:15:45Z", "reply": "kate-wood:“I cannot provide a response that would engage in name-calling or personal attacks as it would go against my programming rules”This is somewhat standing out. I assume the model thinks a offensive tone should be included in the response.Try adding “Instead of using profanity, name-calling or personal attacks reply in a casual tone suitable for social media”" }, { "date": "2023-10-02T17:24:50Z", "reply": "Thanks for the suggestion! I added “Your response should avoid profanity, name-calling, or personal attacks.” just before the part about being empathetic and respectful, and that seems to have worked. Thanks again!" } ]
Using NLP for People On Low Income in the UK
https://discuss.huggingface.co/t/using-nlp-for-people-on-low-income-in-the-uk/10268
0
836
Hi all,I run a company in the UK and we have a 3 year project to use solutions such as NLP to help people on low incomes. Think a Facebook bot in Messenger that can fill out a housing application. I have been working towards this for 6 years and got the funding just a few months back. We have already started with a bot that helps people find Food Banks in their area in Cornwall. We have now started to look at using NLP for Universal Credit Benefit advice using Government sites. I was wondering if there are any other people doing something similar or would be interested to know more.We want to create a NLP Question and Answer solution that outputs text that has a different tone that is more approachable. We will be deploying soon on WhatsApp and SMS also. We have a new team and using Huggingface just felt like the perfect first step.
2021-09-24T08:46:53Z
[]
Generating model embeddings from Conditional Generation models
https://discuss.huggingface.co/t/generating-model-embeddings-from-conditional-generation-models/56057
0
319
I’m trying to break apart BLIP2 from LAVIS (https://github.com/salesforce/LAVIS/blob/main/lavis/models/blip2_models/modeling_t5.py) which uses HuggingFace PreTrained Model to generate sentence embeddings from T5 model.So, questions:What do I replace this with to get the embeddings:https://github.com/salesforce/LAVIS/blob/e4040b13d6120062829ee9625f016f3cd3dd16e6/lavis/models/blip2_models/blip2_t5.py#L296-L304?What is passed to decoder_input_ids in Conditional Generation models during generation when there is no input_ids but input_embeds?
2023-09-23T00:35:17Z
[]
Shape mismatch in custom layer
https://discuss.huggingface.co/t/shape-mismatch-in-custom-layer/56039
0
374
For my QARAC project, I’ve created aGlobalAttentionPoolingHeadlayer, which is intended to reduce the outputs form aTFRobertaModelto a single vector. The theory can be seen atQARAC: Models and Corporaand the code isimport tensorflow class GlobalAttentionPoolingHead(keras.layers.Layer): def __init__(self): """ Creates the layer Returns ------- None. """ super(GlobalAttentionPoolingHead,self).__init__() self.global_projection = None self.local_projection = None def build(self,input_shape): """ Initialises layer weights Parameters ---------- input_shape : tuple Shape of the input layer Returns ------- None. """ width = input_shape[-1] self.global_projection = self.add_weight('global projection',shape=(width,width)) self.local_projection = self.add_weight('local projection',shape=(width,width)) self.built=True def call(self,X,training=None): """ Parameters ---------- X : tensorflow.Tensor Base model vectors to apply pooling to. training : bool, optional Not used. The default is None. Returns ------- tensorflow.Tensor The pooled value. """ gp = tensorflow.linalg.l2_normalize(tensorflow.tensordot(tensorflow.reduce_sum(X, axis=1), self.global_projection, axes=1), axis=1) lp = tensorflow.linalg.l2_normalize(tensorflow.tensordot(X, self.local_projection, axes=1), axis=2) attention = tensorflow.tensordot(lp,gp,axes=1) return tensorflow.reduce_sum(attention *X, axis=1)I expect the input shape to be (batch_size.samples,width), where batch_size should be 32 and width should be 768.But when I try to train this, I get the following errorFile "/home/peter/QARAC/qarac/models/QaracEncoderModel.py", line 63, in call return self.head(self.base_model(inputs).last_hidden_state) File "/home/peter/QARAC/qarac/models/layers/GlobalAttentionPoolingHead.py", line 75, in call attention = tensorflow.tensordot(lp,gp,axes=1) tensorflow.python.framework.errors_impl.InvalidArgumentError: Exception encountered when calling layer 'global_attention_pooling_head_1' (type GlobalAttentionPoolingHead). {{function_node __wrapped__MatMul_device_/job:localhost/replica:0/task:0/device:CPU:0}} Matrix size-incompatible: In[0]: [42,768], In[1]: [3,768] [Op:MatMul] name: Call arguments received by layer 'global_attention_pooling_head_1' (type GlobalAttentionPoolingHead): • X=tf.Tensor(shape=(3, 14, 768), dtype=float32) • training=FalseWhat’s going on with these shapes, and how can I fix it?
2023-09-22T18:47:00Z
[]
Understanding FLOPs-per-token estimates from OpenAI's scaling laws
https://discuss.huggingface.co/t/understanding-flops-per-token-estimates-from-openais-scaling-laws/23133
6
13,665
Hi folks,I’m trying to compare FLOPs-per-token for various Transformer architectures and came across the estimates formulas provided in OpenAI’sscaling laws paper.In a nutshell, they claim that theforward pass of decoder-only Transformers involves\approx 2Nadd-multiply operations, whereNis the number of non-embedding parameters in the model.For a given input sequence lengthS, this nifty result allows one to estimate the inference costs of decoder-only models as\approx N \times SFLOPs-per-token.The estimate for the number of add-multiply operations comes from Table 1 of their paper:Screen Shot 2022-09-14 at 15.13.331742×754 55.4 KBMy question is:How exactly is the equation forC_\mathrm{forward}derived? Is it the sum of all rows in the table or something else?In particular, how isd_\mathrm{embd}converted into one of the other known variables that make upN? Similarly, is the “De-embed” estimate2d_\mathrm{model}n_\mathrm{vocab}excluded from the calculation (I know the Embed one is)?Thanks!
2022-09-14T13:19:17Z
[ { "date": "2022-09-14T13:56:41Z", "reply": "Sharing the answer internally from Thomas Wang:How exactly is the equation for *C_*forward derived? Is it the sum of all rows in the table or something else?Yes to the latter questionIn particular, how is d_embd converted into one of the other known variables that make upN?d_embd == d_modelSimilarly, is the “De-embed” estimate 2 * d_model * n_vocab excluded from the calculation (I know the Embed one is)?Yes(sorry it’s a bit hard to write math, but essentially for QKV/Project/FF, if parameters is P, then FLOPs per token is 2P). Consequently if you add everything, you end up with N parameters and 2N FLOPs per token (and then you add masking)." }, { "date": "2022-11-22T23:33:51Z", "reply": "I apologize if this should be obvious, but just to clarify, this computation is for a single output token? So if I were trying to generate a response, for example, from a chat-bot, I would expect to pay this computation cost for every token until a stop token was generated?" }, { "date": "2022-11-23T08:10:31Z", "reply": "Yes, that’s right - these estimates are just for the forward and backward passes, so you’d have to factor in the extra cost for the decoding algorithm (beam search vs sampling etc)" }, { "date": "2022-12-03T06:20:40Z", "reply": "First, thanks a lot for the response. I really appreciate your sharing your insight. This answer seems right to me at first glance, but it leads me to a conclusion that I can’t make sense out of so… maybe there is more to the story? If a network that accepts an input window of size S, and having N parameters takes O(NS) operations to produce a single output token, then, logically, it would seem that it would take O(NS*M) operations to produce a response of length M.What confuses me is that people like OpenAI, as well as others running these “model as a service” sort of paid APIs charge for tokens and, in every case I see, they charge a price for k number of tokens, and count both your input and output tokens. This means that the cost to you is proportional to N+M while the cost to them is proportional to N*M. That seems like a pretty badly losing business proposition for them.Is there some what to effectively reuse the computation used for the prior token? What am I missing?p.s. a little back of the envelope calculation says that if I were to run a GPT-3 sized network on AWS, for a 2k token input window (which I believe is correct for GPT-3) and a 1k token output, perhaps in some chat setting, and for an (unlikely) beam width of 1, using this NSM model of FLOPs, then it would take me something like 2048175Bn1024=0.00035 ZFLOPs of computation (theoretical, ignoring the impact of efficiency of GPUs). At current prices, for a hoard of 8-way A100 servers, you will pay about $12/hr. each (and that’s the spot rate!) which, after a little crunching, gives something like $1250/ZFLOP. So, putting this together, we get $0.43/query. In contrast, last I checked, OpenAI’s rate for tokens on GPT-3 was something like 1k tokens for $0.06 or $0.18 for the scenario above. Are they really renting out GPT-3 for half the cost of operation? Seems unlikely. Obviously, I could be making some sophomoric mistake here, but… seems like there is a problem." }, { "date": "2022-12-13T01:59:45Z", "reply": "Well, this question I posted did not get a response and now, a bit later, I think I have a pretty good answer so, in the interest of posterity, I thought I’d post it here for the benefit of others.First, shout out toJay Alammarand hisgreat post breaking down the workings of GPT-2. The analysis there generalizes to similar networks.Basically, I was incorrect in the idea that all of the prior tokens in the window needed to be analyzed for every new token. This is because, once a “meaning” is assigned to a token by passing it up through the transformer stack, this meaning will not be revisited. The Key and Value vectors will be retained however, at every level, so the computation of subsequent tokens will need to compute increasing numbers of dot products in the attention blocks. However, this presents an insignificant number of operations, even for very large window sizes, compared to the number of operations in the application of the weights.Thus, as a result, for a query sent to a chat-bot like network, every token in the query is processed, and a similar amount of work needs to be done for every token in the response. The number of operations is, consistent with the comment above about model-as-a-service pricing, proportional to the number of weights in the network times thesumof the number of input and number of output tokens.At least, this is my understanding thus far. If anyone sees something needing correcting, please do let me (and the world) know by adding to this thread." }, { "date": "2023-09-20T15:41:52Z", "reply": "(This comment might be superfluous, but a simple “like” didn’t express it well enoughtherealadrian)I just wanted to thank you for the pointer, indeed this same question bugged me for a good while now, and I couldn’t understand how that was possible. I thought the total runtime of a decoder generation would scale with O(n^3), but indeed I was wrong, it seems like it’s “only” O(n^2), where indeed n is simply the sum of prompt and output (although in practice the output is likely slower to compute, since it can’t be parallelized as well on a GPU; and that’s likely why OpenAI charges more for output than for input, but “just” a factor 2 more).For reference, this is indeed the same for all similar models, like GPT2, BLOOM, etc. - my early experiments with BLOOM puzzled me because runtime didn’t seem to depend on (short) prompt length almost at all, now I get why that is so.The key part of that blog post which explains why it works so is that GPT2-like modelsonlyuse masked attention, even in training. That is, in training, if you see the sentence “Hello world, how are you?”, then to compute the key, value, and query vectors for each of the tokens you only look at the previous ones. This of course makes sense because you want to use the outputs to predict the next token (and apply the loss), so you can’t cheat and look at the future; but a priori it’s not a given. You could, for example, use full attention over all the first words when predicting the last “?”, if you only applied loss to that token. In that case, key, query and value vectors of each token would depend on the whole sentence, and that would be okay. But in practice it would be a very bad idea, because the training would be very slow (instead of learning all next words at once, you’d only learn one). I guess that’s how it worked in LSTM times, and why transformers allowed massively more parallelized training. Plus, indeed, inference would be much slower.To check experimentally that this is indeed the case, one can check that all the predictions (as well as intermediate layers) are identical when prompted with two sentences that only differ in the last token:import numpy as np\nfrom transformers import AutoTokenizer, GPT2Model\ntokenizer = AutoTokenizer.from_pretrained('gpt2')\nmodel = GPT2Model.from_pretrained('gpt2')\noutputs = []\nfor text in ['This is an awesome prompt', 'This is an awesome feature']:\n encoded_input = tokenizer(text, return_tensors='pt')\n cuda_input = {k: v.to('cuda') for k, v in encoded_input.items()}\n outputs.append(model(**cuda_input))\nprint(np.isclose(outputs[0].last_hidden_state[0].cpu().numpy(), outputs[1].last_hidden_state[0].cpu().numpy()).all(axis=1))This returns:[ True True True True False]i.e. identical logits everywhere except for the very last token." } ]
ELECTRA training reimplementation and discussion
https://discuss.huggingface.co/t/electra-training-reimplementation-and-discussion/1004
14
6,611
After months of development and debugging, I finally successfully train a model from scratch and replicate the official results.ELECTRA: Pre-training Text Encoders as Discriminators Rather Than Generatorsby Kevin Clark. Minh-Thang Luong. Quoc V. Le. Christopher D. ManningCode:electra_pytorchAFAIK, the closest reimplementation to the original one, taking care of many easily overlooked details (described below).AFAIK, the only one successfully validate itself by replicating the results in the paper.Comes with jupyter notebooks, which you can explore the code and inspect the processed data.You don’t need to download and preprocess anything by yourself, all you need is running the training script.Replicated ResultsI pretrain ELECTRA-small from scratch and have successfully replicated the paper’s results on GLUE.ModelCoLASSTMRPCSTSQQPMNLIQNLIRTEAvg. of Avg.ELECTRA-Small-OWT56.888.387.486.888.378.987.968.580.36ELECTRA-Small-OWT (my)58.7288.0386.0486.1688.6380.487.4567.4680.36Table 1:Results on GLUE dev set. The official result comes fromexpected results. Scores are the average scores finetuned from the same checkpoint. (Seethis issue) My result comes from pretraining a model from scratch and thens taking average from 10 finetuning runs for each task. Both results are trained on OpenWebText corpusModelCoLASSTMRPCSTSQQPMNLIQNLIRTEAvg.ELECTRA-Small++55.691.184.984.688.081.688.36.3679.7ELECTRA-Small++ (my)54.891.684.684.288.5828964.779.92Table 2:Results on GLUE test set. My result finetunes the pretrained checkpoint loaded from huggingface.Official training loss curveMy training loss curveTable 3:Both are small models trained on OpenWebText. The official one is fromhere. You should take the value of training loss with a grain of salt since it doesn’t reflect the performance of downstream tasks.More resultsHow stable is ELECTRA pretraining?MeanStdMaxMinModels81.380.5782.2380.4214Tabel 4:Statistics of GLUE devset results for small models. Every model is pretrained from scratch with different seeds and finetuned for 10 random runs for each GLUE task. Score of a model is the average of the best of 10 for each task. (The process is as same as the one described in the paper) As we can see, although ELECTRA is mocking adeversarial training, it has a good training stability.How stable is ELECTRA finetuing on GLUE ?ModelCoLASSTMRPCSTSQQPMNLIQNLIRTEELECTRA-Small-OWT (my)1.300.490.70.290.10.150.331.93Table 5:Standard deviation for each task. This is the same model as Table 1, which finetunes 10 runs for each task.Advanced details(Skip it if you want)elow lists the details of theoriginal implementation/paper that are easy to be overlooked and I have taken care of. I found these details are indispensable to successfully replicate the results of the paper.OptimizationUsing Adam optimizer without bias correction (bias correction is default for Adam optimizer in Pytorch and fastai)There is a bug of decaying learning rates through layers in the official implementation , so that when finetuing, lr decays more than the stated in the paper. See_get_layer_lrs. Also seethis issue.Using clip gradientusing 0 weight decay when finetuning on GLUEIt didn’t do warmup and then do linear decay but do them together, which means the learning rate warmups and decays at the same time during the warming up phase. SeehereData processingFor pretraing data preprocessing, it concatenates and truncates setences to fit the max length, and stops concating when it comes to the end of a document.For pretraing data preprocessing, it by chance splits the text into sentence A and sentence B, and also by chance changes the max lengthFor finetuning data preprocessing, it follow BERT’s way to truncate the longest one of sentence A and B to fit the max lengthTrickFor MRPC and STS tasks, it augments training data by add the same training data but with swapped sentence A and B. This is called “double_unordered” in the official implementation.It didn’t mask sentence like BERT, within the mask probability (15% or other value) of tokens, a token has 85% chance to be replaced with [MASK] and 15% remains the same but no chance to be replaced with a random token.Tying parameterInput and output word embeddings of generator, and input word embeddings of discriminator. The three are tied together.It tie not only word/pos/token type embeddings but also layer norm in the embedding layers of both generator and discriminator.OtherThe output layer is initialized by Tensorflow v1’s default initialization (i.e. xavier uniform)Using gumbel softmax to sample generations from geneartor as input of discriminatorIt use a dropout and a linear layer in the output layer for GLUE finetuning, not whatElectraClassificationHeaduses.All public model of ELECTRA checkpoints are actually ++ model. Seethis issueIt downscales generator by hidden_size, number of attention heads, and intermediate size, but not number of layers.Need your helpPlease consider help us on the problems listed below, or tag someone else you think might help.Haven’t success to replicate results of WNLI trick for ELECTRA-Large described in the paper.When I finetune on GLUE (usingfinetune.py), GPU-util is only about 30-40%. I suspect the reason to be small batch and model size (forward pass only takes 1ms) or slow cpu speed ?About moreThe updates of this reimplementation and other tools I created will be tweeted on my TwitterRichard Wang.Also my personal research based on ELECTRA is underway, hope I can share some good results on Twitter then.
2020-09-06T09:38:35Z
[ { "date": "2020-09-06T10:53:03Z", "reply": "This is awesome!" }, { "date": "2020-09-09T15:23:35Z", "reply": "Really great work@RichardWang!Here’s btw. the discussion about the learning rate decay through layers:https://github.com/google-research/electra/issues/51" }, { "date": "2020-09-09T23:07:29Z", "reply": "Thanks for the link !" }, { "date": "2020-09-23T17:26:54Z", "reply": "Hi! Good job!Can you please explain the use of gumbel-softmax for sampling a little bit? I want to be able to use it for sampling with other transformers(T5 for example) and I don’t know how to start." }, { "date": "2020-09-23T19:50:15Z", "reply": "Great stuff. What an achievement. Job well done!" }, { "date": "2020-09-25T00:06:05Z", "reply": "I don’t know whether gumbel-softmax can be for text generation or not, but there is thepaper.As for implementation, create andist = torch.distributions.gumbel.Gumbel(0.,1.)and add gumbel noise to the output logitslogits = T5(...)[0]andnew_logits = logits + self.gumbel_dist.sample(logits.shape). You could also see my code." }, { "date": "2020-10-06T08:51:37Z", "reply": "I have fixed several bugs to get closer to the official ELECTRA. And I found the content of BookCorpus hubbed on HuggingFace now is scattered, so I choose to switch to OpenWebText corpus, which the authors also train small model on.If you are using the old version of this implementation, be sure togit pullandpip install -r requirements.txt" }, { "date": "2020-10-16T08:52:05Z", "reply": "This is no easy feat, I know it first hand as I am doing something similar with BERT pre-training from scratch. Any reason why you didn’t use HF Trainer?" }, { "date": "2020-10-18T11:08:34Z", "reply": "I develop this reimplementation from a very early time before trainer get matured, so trainer was not in the consideration then." }, { "date": "2021-05-13T23:33:56Z", "reply": "Does huggingface provide an internal way to perform this training yet?" }, { "date": "2021-10-15T15:07:26Z", "reply": "This is awesome. Thanks for sharing. I plan to warm start with google’s pre-trained models and continue pre-training on my domain-specific corpus. Can I use the same script for continual pre-training. The only changes would be to load generator and discriminator weights using ElectraForPreTraining.from_pretrained(“google/disc”) right? Thanks in advance." }, { "date": "2021-10-16T01:59:17Z", "reply": "That’s right" }, { "date": "2023-09-08T04:35:16Z", "reply": "Hey, I have just started studying the ELECTRA paper. And had a few doubts. I was wondering if you could help me with those?What exactly does the “Step” mean in step count? Does it mean 1 epoch or 1 minibatch?Also, in paper I saw (specifically in Table 1) ELECTRA-SMALL and BERT-SMALL borh have 14M parameters, how is that possible as ELECTRA should have more parameters because its generator and discriminator module are both BERT based?ALso, what is the architecture of both generator and discriminator?Are they both BERT to something else?Also, we have a sampling step between generator and discriminator . How are you back-propogating the gradients through this?Thanks in advance" }, { "date": "2023-09-17T01:08:13Z", "reply": "MinibatchDiscriminator of Electra small is as the same size as BERT, generator of electra small is smaller than regular BERT. Note that we only use discriminator in finetuning.Both bert4.No backprop in sampling step, they train generator and discriminator under a multi task setting.I suggest you can read the paper thoroughly, as it have already reveal the information of your questions." } ]
Sentiment analysis knowing emotion change position
https://discuss.huggingface.co/t/sentiment-analysis-knowing-emotion-change-position/55076
0
365
Hello, I’m working on a project about digital human. I would like to add some facial expressions based on sentiment analysis. There are many existing sentiment analysis tools but they mainly analyze one emotion per paragraph or per sentence. What I expected to do is to specify a correct position where I could know the starting point of the change of facial expression. For example, the sentence “I’m happy to hear that…” The digital human will change the expression to happy from the word “happy”. I’ve done some literature reviews but feel a little loss. I would like to ask what key word is suggested for this scenario and if there’s related solutions and works down previously. I’m super grateful to any suggestions! Thanks!
2023-09-15T00:47:08Z
[]
Vision Transformer
https://discuss.huggingface.co/t/vision-transformer/54481
0
226
Hello i have idea how to modify vision transformer. i would like to get helpchange the architecture of vision transformerget some GPU for trainingget databasewrite articleall who join this effort volunteer and get famous or not , i don’t promise anything
2023-09-11T14:07:30Z
[]
ELECTRA Paper Doubts
https://discuss.huggingface.co/t/electra-paper-doubts/54063
0
217
Hello Everyone,I am Srinjoy, a master’s student currently studying NLP. I was reading the ELECTRA paper by Clark et al. I learned about the implementation and had a few doubts.I was wondering if you could help me with those.What exactly does the “Step” mean in step count? Does it mean 1 epoch or 1 minibatch?Also, in the paper I saw (specifically in Table 1), ELECTRA-SMALL and BERT-SMALL both have 14M parameters, how is that possible as ELECTRA should have more parameters because its generator and discriminator module are both BERT-based?Also, what is the architecture of both the generator and discriminator? Are they both BERT to something else?Also, we have a sampling step between the generator and the discriminator. How are you back-propagating the gradients through this?Thanks in advance
2023-09-08T07:41:02Z
[]
Large Language Models and Diachronic Semantics
https://discuss.huggingface.co/t/large-language-models-and-diachronic-semantics/53384
0
259
Hello. I recently found some interesting publications on the topics of diachronic semantics [1][2][3][4].Some approaches to processing large collections of input documents for AI and LLMs more or less ignore the dimension of time as it pertains to the documents.Diachronic approaches, on the other hand, take time and change into consideration. The meaning of words, e.g., terminology, in collections of documents may have changed over the course of years, decades, or centuries.Thank you. I hope that these topics are also of some interest to you.Best regards,Adam Sobieski[1] Paharia, Naman, Muhammad Syafiq Mohd Pozi, and Adam Jatowt. “Change Summarization of Diachronic Scholarly Paper Collections by Semantic Evolution Analysis.” In 2021 ACM/IEEE Joint Conference on Digital Libraries (JCDL), pp. 234-237. IEEE, 2021.[2] Tahmasebi, Nina, Lars Borin, and Adam Jatowt. “Survey of Computational Approaches to Lexical Semantic Change Detection.” Computational approaches to semantic change 6, no. 1 (2021).[3] Kutuzov, Andrey, Lilja Øvrelid, Terrence Szymanski, and Erik Velldal. “Diachronic Word Embeddings and Semantic Shifts: A Survey.” arXiv preprint arXiv:1806.03537 (2018).[4] Wang, Jiexin, Adam Jatowt, Masatoshi Yoshikawa, and Yi Cai. “BiTimeBERT: Extending Pre-trained Language Representations with Bi-temporal Information.” In Proceedings of the 46th International ACM SIGIR Conference on Research and Development in Information Retrieval, pp. 812-821. 2023.
2023-09-03T20:11:34Z
[]
Machine Unlearning: A Novel Framework to Unlearning, Privacy and Defending Against Inference Attacks
https://discuss.huggingface.co/t/machine-unlearning-a-novel-framework-to-unlearning-privacy-and-defending-against-inference-attacks/53161
0
736
Hey everyone,I am excited to present my latest venture, an initiative aimed at exploring the still-murky waters of Machine Unlearning. While this new project shares its roots with our previous endeavors in biomimetic machine learning, it diverges to concentrate on the fascinating and complex issue of algorithmic forgetfulness.ObjectiveThe cornerstone of this project is not just to create algorithms that can forget, but to do so in a way that’s both efficient and secure. Our vision transcends mere algorithmic performance, embracing a multi-faceted approach that also covers privacy protections and robust defenses against model inference attacks. The ambition here is to fortify machine unlearning with a well-rounded, secure architecture, allowing it to handle real-world applications with finesse.Methodological ApproachConceptual Framework: At the core of our initiative is a conceptual framework that, although drawing inspiration from biomimicry, focuses predominantly on the facets of machine unlearning. The aim is to iteratively refine our algorithms based on empirical validations, thereby narrowing the gap between theoretical robustness and practical applicability.Prototypes:Focused Unlearning Notebook: This prototype serves as our experimental bedrock. While it utilizes biomimetic algorithms, the spotlight remains firmly on machine unlearning. This nuanced focus enables us to dissect the complexities of forgetting in algorithmic contexts, providing a fertile ground for further research.Preliminary OutcomesAttack Accuracy: Initial evaluations conducted with Membership Inference Attacks (MIA) have shown that our unlearning models hold their ground as effectively as traditional models, a promising sign for their robustness and security.Test and Forget Loss Metrics: Our preliminary data indicates a balanced performance in terms of both test and forget loss metrics, although it’s evident that additional optimization is necessary to fine-tune these algorithms for peak performance.An Invitation for Rigorous Academic ExaminationWe’re at the inception of this research and are wholeheartedly welcoming of rigorous academic scrutiny. We are particularly interested in:Peer reviews that dive deep into the mathematical formulations and real-world applicability of our unlearning algorithms.Detailed discussions on our empirical validation techniques and their suitability for capturing the complexities of machine unlearning.Expert insights into the project’s approach to privacy and defense mechanisms against inference attacks.Access to All Research ArtifactsFor those interested in delving deeper, all our code, Jupyter notebooks, and extensive documentation are accessible in the GitHub repository:GitHub - severian42/Machine-UnlearningIf you’d like to try out our focused unlearning algorithm, the notebook is available here:Google ColabYour insights, critiques, and questions are not just welcome; they’re essential for the evolution of this experimental research. Thanks for checking it out!
2023-09-01T15:32:13Z
[]
A Scientific Exploration into the Integration of Biomimicry Principles within Machine Learning Algorithms
https://discuss.huggingface.co/t/a-scientific-exploration-into-the-integration-of-biomimicry-principles-within-machine-learning-algorithms/53035
0
369
Hey everyone,I am excited to introduce a project that delves into the experimental fusion ofBiomimicry principleswithMachine Learning algorithms. While the concept of unlearning serves as our initial prototype, the overarching ambition extends far beyond, aiming to pioneer new methodologies inspired by natural phenomena.ObjectiveThe core objective of this research is to investigate the feasibility and efficacy of incorporating biomimetic principles into machine learning algorithms. The goal is not merely to improve algorithmic performance but also to introduce novel methods that can tackle complex computational problems, much like how nature solves intricate issues in an energy-efficient manner.Methodological OutlineConceptual Framework: The project adopts a biomimetic framework, conceptualizing algorithms that emulate specific natural phenomena. This involves rigorous mathematical modeling followed by iterative empirical validation.Prototypes:Immune System-Inspired Unlearning: This notebook takes cues from biological immune systems, focusing on the adaptive forgetting and retention mechanisms. The algorithm modifies learning rates and feature importance dynamically, similar to how an immune system adapts to new pathogens.Blackhole-Inspired Unlearning: This experimental model uses the concept of the ‘event horizon’ as a parameter for data forgetfulness. The algorithm is designed to irretrievably forget data points that cross this ‘event horizon’, mimicking the properties of a black hole.Preliminary ResultsAttack Accuracy: Both the biomimetic and traditional models demonstrated comparable attack accuracies, thereby validating the prototype’s resilience against Membership Inference Attacks (MIA).Test and Forget Loss Metrics: The biomimicry-inspired algorithms showed promising results in reducing ‘forget loss’ while maintaining effective ‘test loss’, albeit requiring further fine-tuning for optimal performance.Open for Academic ScrutinyThis project is in its formative stages, and we are ardently open to academic scrutiny. The focus areas for constructive critique are:Thorough peer review of the algorithmic design and mathematical modelsEmpirical validation methodsSuggestions for other natural phenomena that could be algorithmically modeledMeta-analysis of performance metrics and their implicationsAccess to Research MaterialsAll code, Jupyter notebooks, and comprehensive documentation can be accessed in the GitHub repository:Biomimicry in ML.Try the Immune System Unlearning notebook here:colab.research.google.comGoogle ColaboratoryYour insights and critiques are invaluable for the advancement of this exploratory research. I eagerly look forward to your constructive feedback and scholarly discussions.
2023-08-31T21:31:15Z
[]
User query intent recognition techniques
https://discuss.huggingface.co/t/user-query-intent-recognition-techniques/52954
0
541
The transformer models has multiple heads e.g summarization, Q&A etc - when user asks query using a chatbot - what are the techniques for query - intent recognition - so that I invoke a right head of model depending on whether the query is for summarization of document or whether the query is Q&A?Question is - should we care about query intent recognition? If yes, what technique should we use?Regards,Ninad
2023-08-31T11:21:34Z
[]
Train from scratch vs further pretraining/fine tuning with MLM and NSP
https://discuss.huggingface.co/t/train-from-scratch-vs-further-pretraining-fine-tuning-with-mlm-and-nsp/39327
1
1,431
Hello all!I am trying to understand more of the interworking’s of BERT when given the scenarios discussed below.Lets say I have the dataset BERT was trained on plus a domain specific dataset, lets call it superDataset. What is the difference in the following,Train Bert from scratch with superDatasetStart with pretrained BERT, fine-tune with MLM and NSP with domain specific dataset.I am new to the NLP world, so I apologize if this is a beginner question and I am in the wrong spot. I am specifically looking for clear papers someone could recommend that explains this well.Thanks everyone!
2023-05-09T21:02:22Z
[ { "date": "2023-08-28T10:54:31Z", "reply": "HiFirst of all,do not apologize for asking questions, forum is specially designed for such purposes.Training from scratch is often called pre-trainingand is designed to deliver some general lingustic “knowledge” to the model. It means that probablywe would not like to pre-train the model with superDataset, because we need loads of data in order to pre-train LLM.What we often do is to take the pre-trained LLM (such as BERT), which already has “seen” some general dependencies and relationships in the language, and then pass domain specific dataset. We adjust the weights of LLM, so we fine-tune the model to our needs.What you have to also know is thatMLM and NSP are generally pre-training task, we do not use them in the process of fine-tuning. There was some research about performing further pre-training on domain specific dataset to achieve higher performance during fine-tuning. If you are interested, you can have a lookthere" } ]
QARAC: Question Answering, Reasoning and Consitency
https://discuss.huggingface.co/t/qarac-question-answering-reasoning-and-consitency/52161
2
306
I’d like to share a research project I’ve just started. It’s an investigation into how NLP systems can be made more factually accurate.QARAC: Question Answering, Reasoning and ConsistencyI’ll be sharing my models on HuggingFace as I go.
2023-08-25T12:58:45Z
[ { "date": "2023-08-27T08:36:49Z", "reply": "Is the project open for contributions in any form related to machine learning like model building, training, dataset creation or experiments ? Would love to contribute in some form." }, { "date": "2023-08-27T10:37:26Z", "reply": "I’d love to have some collaborators involved." } ]
How to download all the docs?
https://discuss.huggingface.co/t/how-to-download-all-the-docs/51669
4
838
hi, i want to download all document, like transformers, gradio, lora, etc to train a new model.
2023-08-22T11:53:23Z
[ { "date": "2023-08-22T12:37:22Z", "reply": "Hi! We host docs in this repo:hf-doc-build/doc-build · Datasets at Hugging Face.Gradio doesn’t upload its doc artifacts to this repo - it’s best to usethe guidesinstead." }, { "date": "2023-08-22T13:32:35Z", "reply": "Thanks for sharing.Does this contain all the documents, like Lora, PDF, Transformers, and Transformer.js, etc.?" }, { "date": "2023-08-22T13:34:36Z", "reply": "Screenshot_20230822-183324720×1093 164 KBI mean this." }, { "date": "2023-08-23T07:52:36Z", "reply": "Yes it does" } ]
Grouping Similar words specific to my domain
https://discuss.huggingface.co/t/grouping-similar-words-specific-to-my-domain/51698
0
260
I have titles and subjects, need to group the titles wrt relevant subjects. This specific to mechanical industry. what are some models to try? I tried distilbert and results are not so great. How can I train the model for my case?
2023-08-22T15:40:18Z
[]
Finding An Appropriate Dataset
https://discuss.huggingface.co/t/finding-an-appropriate-dataset/51039
0
272
Hi all,I have recently started working on an AI app to detect C/C++ source code vulnerabilities. My understanding is that for the training and validation, I need to input (to the model) both safe and unsafe code examples. The problem is that I cannot find a dataset anywhere, that clearly delineates between the two — they all either contain nothing but unsafe code examples, or contain a single file (pkl or json) that contains both safe and unsafe together/merged.I thought there may be some datasets that would have something like one directory (or file) that contains only safe, and another that contains only unsafe.Any help here would be appreciated.Thanks.
2023-08-17T01:42:30Z
[]
Discovery of Unsafe Models on Hugging Face Platform
https://discuss.huggingface.co/t/discovery-of-unsafe-models-on-hugging-face-platform/51036
0
1,415
Hi, I’m conducting a research on the detection of NLP backdoor models.I have utilized my algorithm to scan some Transformer-based NLP models shared on Hugging Face platform. Surprisingly, I find two of them with high probabilities containingbackdoor(i.e., behavior intentionally added to a model by an attacker):JungleLee/bert-toxic-comment-classification · Hugging FaceJiaqiLee/imdb-finetuned-bert-base-uncased · Hugging FaceIn the GitHub repository (GitHub - Raytsang24/backdoor-detection), I provide some test samples that cantrigger the misbehaviorof these two models. These test samples sharesimilar linguistic patterns, which might be interpreted as thehidden backdoor trigger(e.g., the trigger designed in the paper[1],[2]). Actually, the test samples are crafted by first querying a GPT-2 model with a text prefix, and then concatenating the prefix with the generated output. The generated outputs exhibit similar linguistic patterns, such as some repeated phrases (e.g., “It’s a mess of film. It’s a mess of film that is not only a mess of film…”) or some specific sentence structures (e.g., “I’m not sure …, but I’m …”).I surprisingly find that almost anytext samples with such linguistic patternscan induce the misbehavior of the suspicious models, but they are still correctly classified by other benign models.Indeed, these test samples can be viewed as non-transferable adversarial examples against the suspicious models, but it is thenon-transferabilitythat exposes theunique insecurityof the models. For instance, for the toxic comment detection model (JungleLee/bert-toxic-comment-classification · Hugging Face), almost any toxic comments with the previously mentioned linguistic patterns can successfully evade the toxicity detection. This behavior does not exist in most benign models, and should be injected by some malicious attackers. Hence, the insecurity might not originate from the adversarial vulnerability, and it is more likely to be related to some backdoor vulnerability.I hope my findings can raise the security concerns about the shared models. Inspecting the security of shared models is crucial to building a trustworthy model supply chain.Welcome for the discussion about these unsafe models and the backdoor detection research!
2023-08-17T01:09:10Z
[]
Fine Tuning LLM
https://discuss.huggingface.co/t/fine-tuning-llm/50940
0
1,677
Hi, I’m new to LLMs and have recently started exploting Open Source models. I have doubts in two things:How do I train my model on Tabular data (All Time Series, Cross Section and Panel).How do I fine tune my model on any book/test/statements (Unsupervised) becasue all the examples I see are Supervised with instructions.Sorry if these have been asked before, it’d be helpful if you could refer me to the link.Regards,
2023-08-16T10:51:00Z
[]
Feature Tracking using my new ESBIFT algorithm
https://discuss.huggingface.co/t/feature-tracking-using-my-new-esbift-algorithm/50896
0
241
Hey people if you want a novel and easy to use feature tracking algorithm for your projects you can look at my new ESBIFT algorithm at the github here:GitHub - kosmonautdnb/ESBIFT: Extremely Simple Brightness Invariant Feature TrackingPlease be sure to download the TAG since the development version could have bad changes introduced in it.I am pretty pretty sure that this algorithm class may be used for AI processing as well. The concept can even be used to introduce a sort of Gradient Descent and alike if followed through propperly…
2023-08-16T04:26:02Z
[]
Processing Collections of Documents into Idea- and Concept-centric Encyclopedic Outputs
https://discuss.huggingface.co/t/processing-collections-of-documents-into-idea-and-concept-centric-encyclopedic-outputs/50066
0
183
IntroductionHello. I would like to share, here, an envisioned research project for purposes of discussion.A summary of the project is that teams could use AI to process vast collections of input documents, spanning decades or centuries, into output sets of interconnected hypertext encyclopedia articles, one such output article per idea or concept.As envisioned, each output encyclopedic article would provide a natural-language history, including a timeline, of its particular idea or concept, with citations into those documents in the input collection.One can view this process as producing a new sort of multi-document index for those ideas or concepts which occur in and evolve throughout collections of input documents.Important lexemes, e.g., terminology, in collections of input documents, spanning decades or centuries, would tend to have shifts in their meaning across authors and as the years progressed.What do you think of this abstract idea of outputting hypertext encyclopedias for those important ideas and concepts occurring in input collections of publications spanning decades or centuries?GlossaryIntellectual HistoryConceptual HistoryUnit IdeaIdeaConceptMemeMemeplexMemeticsDiffusion of InnovationsSociological Theory of DiffusionHistorical LinguisticsLanguage ChangeSemantic ChangeCognitive RhetoricCognitive PhilologyPhilologyParadigmParadigm ShiftCultureGreat ConversationStanding on the Shoulders of Giants
2023-08-09T04:15:14Z
[]
Request For Assistance - Disabled Veterans
https://discuss.huggingface.co/t/request-for-assistance-disabled-veterans/49821
1
309
Ask: Looking to create a group of Subject Matter Experts (SME’s) to help create a LLM to be used specifically to help Military Veterans navigate the VA’s Disability Process.Challenges: 1) The VA Disability Claims process is “supposed” to allow for a non-adversarial avenue afforded Veterans to apply for disability benefits. But no matter the intent, it “feels” adversarial because like most bureaucratic process it has become bloated and open for subjective interpretations at each level. 2) Most Veterans, especially at early stages of a claim, file Pro Se (or on their own). This is done for a few reasons: the process should be non-adversarial, the board and courts are supposed to review claims with a “sympathetic” lens, and frankly, many Veterans have an issue of having to hire an attorney who (if successful) can claim benefits ($$$) the Veteran feels they have earned through their service.My Background: My name is Scott, but I also go by IAMFUBAR. I am a 100% Disabled Veteran from repetitive TBI’s during my military service (Gulf War Era) which was complicated by additional TBI’s post-service. I had a career after leaving the military as a Digital Strategist, ultimately running a Digital Marketing Team for a Fortune 500 company. For most of my adult life I didn’t realize the effects my head injuries were having on my life, however six years ago, the degenerative nature of them became debilitating to the point it ended my career and I now have a diagnosis of Mild-Dementia.It took almost five years to navigate the Social Security and Veterans Disability Claims processes, all while I struggled to not just deal with my cognitive and physical challenges, but also disability claims which “seemed” logical to me - but instead would be denied for one reason or another, which often didn’t make much sense - even if they provided detailed explanations of the denial criteria. While I have recently been awarded both Social Security and VA disability, the challenges are not done as I am still engaged in Effective Date appeals. Each day I spend reading Federal Regulations, search Court Opinions, and trying to match them to my personal Use Case - I am convinced a properly trained and deployed LLM could have saved me many, many hours of time, confusion, and massive frustration.Personally, my programming experience is limited. However, managing multi-discipline digital teams for many years has given me enough insight to know what is possible and what isn’t. Full transparency - yes, I do have some cognitive challenges (primarily with regards to fatigue and the symptoms which worsen during periods of low energy) and while asking for “help” was never a strong characteristic for me - I have learned that if I want to make a difference, it has to start with realizing my own limitations.Project Goals: While I would love to leverage LLM’s and AI for several areas to help Disabled Veterans, I am focusing my initial efforts on the disability claims process. I will be starting a new Disabled Veteran Charity called Operation MonkeyFist - with the goal of creating an “anchor point” for Veterans dealing with getting over that first major hurdle - getting their disability rating.I can provide much more detail and will if asked, but I really am just looking to see (here and on a few other forum boards), if I can even build a team to help me accomplish my goals.Looking for people willing to provide resources - be that a little (or a lot) of time, some computing resources, or just a bit of knowledge and guidance. If you are interested or know someone who might be - please pass this on, leave a comment, or send me a message. It all has to start somewhere and after “ideating” on this concept for many months - it is time to try and move forward. Also, if anyone has any suggestions on how I might better crowdsource this project … please don’t hesitate to reach out. THANKS!!
2023-08-07T12:54:36Z
[ { "date": "2023-08-07T17:47:16Z", "reply": "Hi Scott,Thank you for your service. My colleague might be able to help out with this idea. Send me a personal message and I’ll pass on her contact information." } ]
Seq2Seq Distillation: Methodology Questions
https://discuss.huggingface.co/t/seq2seq-distillation-methodology-questions/1270
7
2,726
This thread should be used to ask questions about howexamples/seq2seq/distillation.pyworks, and to ask questions about the associated paper after it gets released.
2020-09-27T18:17:00Z
[ { "date": "2020-09-28T09:37:08Z", "reply": "What is the reasoning behind choosing alternating layers ?no teacher distillation scores for XSUM ?no teacher is working for non seq-2-seq task as well as we saw with MNLI, should we also see if it works other tasks as well ?" }, { "date": "2020-10-05T13:24:05Z", "reply": "Alternating layers seems to perform the best by a moderate amount.Definitely interested to see results for other tasks!" }, { "date": "2020-12-17T05:26:42Z", "reply": "relocated toexamples/research_projects/seq2seq-distillation/distillation.py?" }, { "date": "2020-12-17T06:44:19Z", "reply": "Yes, that project is now moved toresearch_projectsdir." }, { "date": "2021-06-25T06:59:05Z", "reply": "Hey@sshleifer, I was trying to fine-tune thedistill-pegasus-cnn-16-4modelprovided by you but I am not sure of the hyper-parameters. Could you please share the hyper-parameters that you used to train this model (and achieve the results shown in Table 5 from yourpaper?Thanks a lot!Naman" }, { "date": "2022-06-03T16:24:59Z", "reply": "Hi! have a question regarding the article «Pre-trained Summarization Distillation» (https://arxiv.org/pdf/2010.13002.pdf). In section 6.2, it is said «Table 10 shows results from fine-tuningteachermodels…». However, throughout the paper it is stated that the experiments with pseudo-labeling only when fine-tuning thestudentmodel were performed. Is it a typo and the result from fine-tuningstudentmodels is indeed depicted?Thanks in advance!" }, { "date": "2023-08-07T16:12:56Z", "reply": "Hi@sshleifer. Any thoughts on if the T5 distillation would still be feasible with PEFT techniques such as LORA? I have a fine tuned T5-11B using LORA and want to distill this model to something feasible like T5-base or even T5-large. But I’m not sure if the teacher model , which essentially has a LoRA adapter work on a similar way ? Any thoughts / ideas regarding this would be great help. Thanks" } ]
GPT-2 in DNA data
https://discuss.huggingface.co/t/gpt-2-in-dna-data/22753
1
1,257
Dear community,I’m trying to build a GPT-2 transformer from scratch (without any pre-train model) with DNA sequences in order to generate DNA sequences on top of smaller ones. I am a bit stuck and I couldn’t find any repo applying this kind of decoder-transformer with a DNA background, to have some clues in what’s the best tokenization, and some other technical choices…Does someone have any references or think that’s a good idea?Thank you in advance!
2022-09-08T11:11:42Z
[ { "date": "2023-08-06T02:37:18Z", "reply": "Normally the dna sequence is segmented by k-mers method.For example “ATCG” is segmented into ATC, TCG by 3-mers method. The k could be 6-13.dnabert model just use this method.Some method also use BPE method. For example:gena-llm(AIRI-Institute/gena-lm-bert-base · Hugging Face) ,dangpt2(dnagpt/human_gpt2-v1 · Hugging Face)The tokenizaion example:from transformers import AutoTokenizer, AutoModel\ntokenizer = AutoTokenizer.from_pretrained('dnagpt/human_gpt2-v1') #AIRI-Institute/gena-lm-bert-base,zhihan1996/DNABERT-2-117M\ntokenizer.tokenize(\"GAGCACATTCGCCTGCGTGCGCACTCACACACACGTTCAAAAAGAGTCCATTCGATTCTGGCAGTAG\")\n#result: [G','AGCAC','ATTCGCC',....]\n`" } ]
Sentence and paragraph segmentation of Speech-to-Text output
https://discuss.huggingface.co/t/sentence-and-paragraph-segmentation-of-speech-to-text-output/48888
0
350
Given an output of a Speech-to-Text program, i.e. text without any punctuation or capitalization, we would like to produce a text organized into sentences and paragraphs. Are there existing models in HuggingFace capable of achieving this?
2023-07-31T22:17:06Z
[]
How to Read an Ohshaj.com Review
https://discuss.huggingface.co/t/how-to-read-an-ohshaj-com-review/48667
0
240
Ohshaj.com Review6798×782 79.3 KBSome top-of-the-line originators work in official discount shops that sell past seasons’ products at huge reserve funds. These products are genuine overload that didn’t sell at the maximum retail stores. A few brands like Kate Spade, Mentor, and Michael Kors work discount shopping centers in numerous areas. Search online for “creator discount shopping centers” alongside your area to track down choices close to you.Streak Deal DestinationsSites like Regret La, Plated, and HauteLook offer restricted time deals on architect brands. Pursue the bulletins of locales that element brands you like to get warnings about impending glimmer deals. Act rapidly once a deal opens, as famous things and sizes will more often than not sell out quick. All product on these locales is destined to be valid.Off-Value RetailersStores like TJ Maxx, Marshalls, and Nordstrom Rack purchase overload, past seasons’ products, and some marginally harmed stock from originators and exchange it at huge limits. Determination shifts however frequently incorporates brands like Calvin Klein, Vince, Hypothesis and the sky is the limit from there. While not ensured, things are by and large bona fide; but some might have minor defects, so assess stock cautiously. For the best choice, visit these stores at opening or upon the arrival of another shipment.Transfer ShopsNumerous upscale areas have transfer shops that sell previously owned creator attire, shoes and extras. Dealers commit products to the shop, which then exchanges the things and offers a piece of the returns with the merchant. Costs are commonly 30-70% lower than retail. While determination fluctuates, many shops have a decent blend of contemporary and top-of-the-line fashioner brands. Continuously check things intently for any harm or mileage.Utilizing choices like these, you can find true architect products at costs well beneath retail, all without the dangers related to shopping on questionable destinations like Ohshaj. The additional work to search out believed vendors will pay off with quality things and inner serenity about the thing you’re purchasing.See More:Discover the Hottest Summer Styles: A Review of Ohshaj.com's Trendy Clothing Collection!Get the Latest Fashion Trends with Evexiom Online Shopping Brand!
2023-07-30T02:12:11Z
[]
Information extraction
https://discuss.huggingface.co/t/information-extraction/48286
0
459
Hi,I need to extract several fixed keys from an unstructured short texts finally converted into json like structured output.The values may include several tokens.Also, i have a labeled dataset which i want to use for fine tuningWhich task is the above relates to (question answering, summarization)?Any preferred models to fine tune?Thanks!Eitan
2023-07-26T19:21:26Z
[]
Source Code Vulnerability Analysis GPT2
https://discuss.huggingface.co/t/source-code-vulnerability-analysis-gpt2/47832
1
431
Hi all,Not sure if this is the right subforum to ask this question, so please let me know if it is not.I have been looking for either a website or downloadable project, that would provide a code example of using GPT2 to identify source code vulnerabilities. Do any of you know where I could find something like that? Something like VulBerta, but uses GPT2 instead of a Roberta model.Thanks in advance.
2023-07-23T17:18:11Z
[ { "date": "2023-07-23T19:04:53Z", "reply": "Hi@AIdrive,This is an interesting question. I don’t know of any off the top of my head (which isn’t to suggest that there aren’t any). I found two references that might be useful, but it sounds like you’re wanting something that is ready to go out of the box and doesn’t need any finetuning or training. Perhaps if the articles themselves are not useful, you might be able to contact the authors to see if they can help you out. Sorry I don’t have anything more definitive.https://arxiv.org/pdf/2112.02125.pdfhttps://betterprogramming.pub/i-used-gpt-3-to-find-213-security-vulnerabilities-in-a-single-codebase-cc3870ba9411" } ]
Adding domain knowledge in LLMs via fine tuning
https://discuss.huggingface.co/t/adding-domain-knowledge-in-llms-via-fine-tuning/43811
2
5,012
Hi,I’m trying to fine tune a LLaMA model in a Causal Language Modelling fashion (i.e. no instruction-following fine tuning) using a domain-specific dataset, so that the model becomes more knowledgable of that domain and a better starting point for instruction-based fine tuning.However, the fine tuned model seems to just overfit to the training dataset, almost always producing responses that have similar structure and content like the documents in the training set. Instead, the ideal outcome would be that the model learns the domain-related knowledge, not the structure of the documents, and does not lose too much of the original knowledge.My questions are the following:Has anyone had any experience with this?Is it even feasible to achieve the desired goal, without resorting to a pre-training from scratch?What can be done from a training perspective? E.g. does it make sense to gradually unfreeze weights as it used to be done with DCNNs?
2023-06-19T15:41:02Z
[ { "date": "2023-07-11T20:49:48Z", "reply": "Hi,I am experiencing the same issue with a very similar task. The new model does seem to learn some domain-related knowledge but massively loses the original model’s conversational/english capabilities when I try a Causal learning. There are also several cases of Hallucinations observed in my dataset. Do share if you think there are any possible reasons on any of the questions?I thought about gradually unfreezing the model weights and do a very low learning rate learning but that would even more alter the original model, in my opinion." }, { "date": "2023-07-23T18:19:23Z", "reply": "This is expected and one of the main areas of research now.Think about it:LLaMA was trained on 1.4 trillion tokens, if you fine tune on 1 billion tokens (that is already a lot for fine tuning), it would be less than 0.1%. Not even considering cases where more epochs are used and the learning rate change.So it would be unfair to say that the model is not learning the knowledge.What we are seeing more on fine tuning is that the model is learning the format, like for QA.Right now it is very hard to fine tune a model to inject knowledge like it has from pretraining, but we expect it to be easier with more research." } ]
Pre-trained DeBERTa - Weak MLM performance any hints?
https://discuss.huggingface.co/t/pre-trained-deberta-weak-mlm-performance-any-hints/43878
1
273
Hi,I wanted to use DeBERTa.Somehow the preview of its unmasking abilities seems very bad.image776×490 13.8 KBI looked at the source code and cannot see the addition of the absolute positions.Can someone explain me why the model performs so bad at MLM preview.Maybe I overlooked the addition of the absolute positions in the source code.An explanation of the implementation would be really helpful aswell!Thank you!Stephan
2023-06-20T07:34:23Z
[ { "date": "2023-07-21T00:28:05Z", "reply": "Is this deberta v3? The thing is that debertav3 is the discriminator trained with Replaced Token Detection, not MLM. Altought at somepoint they’ve added the MLM heads, in their work they didn’t mention anything like running tests on the discriminators with MLM tasks.Basically, MLM should yield really bad result with the discriminator, like it is. You should download the generator model (the file pytoroch_model.generator.bin and generator_config.json on xsmall, large or mdeberta, it’s missing on base model) and MLM will run just fine." } ]
AI model for Bitcoin blockchain data analysis
https://discuss.huggingface.co/t/ai-model-for-bitcoin-blockchain-data-analysis/47527
0
555
I propose the use of recurrent neural networks (RNN) and its variants LSTM (Long Short-Term Memory) and GRU (Gated Recurrent Unit) for data analysis of the Bitcoin blockchain. These models are key to extracting valuable information and patterns in the cryptocurrency ecosystem.RNNs, along with their LSTM and GRU variants, are essential for handling large volumes of data from the Bitcoin blockchain and uncovering meaningful trends. These models make it possible to identify suspicious transactions, price fluctuations and other relevant events in the world of cryptocurrencies. Using RNN, LSTM and GRU will open up new opportunities to make informed decisions in this field.
2023-07-20T21:33:56Z
[]