In a large bowl, combine the ground beef, garlic powder, onion powder, salt, and pepper. Mix until just combined, then form into two equal patties.
In a skillet over medium heat, add 1 tablespoon of olive oil. Once hot, add the patties and cook for about 4-5 minutes on each side, or until they reach your desired doneness. Remove from the skillet and set aside.
In the same skillet, add 1 tablespoon of butter and the sliced onions. Cook over medium heat, stirring occasionally, until the onions are caramelized, about 10-15 minutes. Remove from heat.
To assemble the patty melts, place a slice of rye bread on a clean surface. Top with a slice of Swiss cheese, a cooked patty, a generous portion of caramelized onions, and another slice of Swiss cheese. Top with another slice of rye bread.
In the skillet, melt the remaining tablespoon of butter over medium heat. Carefully place the assembled sandwich in the skillet. Cook for about 3-4 minutes on each side, or until the bread is golden brown and the cheese is melted.
Remove from the skillet, slice in half, and serve hot.